Skip to content

Commit 5411cd3

Browse files
krczeckguruxu
authored andcommitted
added comments to show options (#85)
* added comments to show options * fixing travis error * fixing travis errors * travis error file
1 parent d18d3d6 commit 5411cd3

11 files changed

Lines changed: 82 additions & 1 deletion

examples/categories.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@
1515

1616
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1717
""" Run the example """
18-
categories_url_data = "https://onlocationvacations.com/2015/03/05/the-new-ghostbusters-movie-begins-filming-in-boston-in-june/"
18+
categories_url_data = "https://onlocationvacations.com/2018/02/06/downton-abbey-exhibition-extended-april-2-nyc/"
1919
url = categories_url_data
2020
# Create an API instance
2121
api = API(user_key=key, service_url=alt_url)
22+
23+
# Set selected API options
24+
# For more information on the functionality of these
25+
# and other available options, see Rosette Features & Functions
26+
# https://developer.rosette.com/features-and-functions#categorization
27+
28+
# api.set_option('singleLabel', 'true')
29+
# api.set_option('scoreThreshold',- 0.20)
30+
2231
params = DocumentParameters()
2332

2433
# Use a URL to input data instead of a string

examples/entities.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1515
""" Run the example """
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
18+
19+
# Set selected API options.
20+
# For more information on the functionality of these
21+
# and other available options, see Rosette Features & Functions
22+
# https://developer.rosette.com/features-and-functions#entity-extraction-and-linking
23+
24+
# api.set_option('calculateSalience','true')
25+
# api.set_option('linkEntities','false')
26+
1827
entities_text_data = "The Securities and Exchange Commission today announced the leadership of the agency’s trial unit. Bridget Fitzpatrick has been named Chief Litigation Counsel of the SEC and David Gottesman will continue to serve as the agency’s Deputy Chief Litigation Counsel. Since December 2016, Ms. Fitzpatrick and Mr. Gottesman have served as Co-Acting Chief Litigation Counsel. In that role, they were jointly responsible for supervising the trial unit at the agency’s Washington D.C. headquarters as well as coordinating with litigators in the SEC’s 11 regional offices around the country."
1928
params = DocumentParameters()
2029
params["content"] = entities_text_data

examples/morphology_complete.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
1818

19+
# Set selected API options.
20+
# For more information on the functionality of these
21+
# and other available options, see Rosette Features & Functions
22+
# https://developer.rosette.com/features-and-functions#morphological-analysis-introduction
23+
24+
# api.set_option('modelType','perceptron') #Valid for Chinese and Japanese only
25+
1926
morphology_complete_data = "The quick brown fox jumped over the lazy dog. 👍🏾 Yes he did. B)"
2027
params = DocumentParameters()
2128
params["content"] = morphology_complete_data

examples/morphology_compound-components.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
1818

19+
# Set selected API options.
20+
# For more information on the functionality of these
21+
# and other available options, see Rosette Features & Functions
22+
# https://developer.rosette.com/features-and-functions#morphological-analysis-introduction
23+
24+
# api.set_option('modelType','perceptron') #Valid for Chinese and Japanese only
25+
1926
morphology_compound_components_data = "Rechtsschutzversicherungsgesellschaften"
2027
params = DocumentParameters()
2128
params["content"] = morphology_compound_components_data

examples/morphology_han-readings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1515
""" Run the example """
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
18+
# Set selected API options.
19+
# For more information on the functionality of these
20+
# and other available options, see Rosette Features & Functions
21+
# https://developer.rosette.com/features-and-functions#morphological-analysis-introduction
22+
23+
# api.set_option('modelType','perceptron') #Valid for Chinese and Japanese only
1824

1925
morphology_han_readings_data = "北京大学生物系主任办公室内部会议"
2026
params = DocumentParameters()

examples/morphology_lemmas.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
1818

19+
# Set selected API options.
20+
# For more information on the functionality of these
21+
# and other available options, see Rosette Features & Functions
22+
# https://developer.rosette.com/features-and-functions#morphological-analysis-introduction
23+
24+
# api.set_option('modelType','perceptron') #Valid for Chinese and Japanese only
25+
1926
morphology_lemmas_data = "The fact is that the geese just went back to get a rest and I'm not banking on their return soon"
2027
params = DocumentParameters()
2128
params["content"] = morphology_lemmas_data

examples/morphology_parts-of-speech.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
1818

19+
# Set selected API options.
20+
# For more information on the functionality of these
21+
# and other available options, see Rosette Features & Functions
22+
# https://developer.rosette.com/features-and-functions#morphological-analysis-introduction
23+
24+
# api.set_option('modelType','perceptron') # Valid for Chinese and Japanese only
25+
1926
morphology_parts_of_speech_data = "The fact is that the geese just went back to get a rest and I'm not banking on their return soon"
2027
params = DocumentParameters()
2128
params["content"] = morphology_parts_of_speech_data

examples/sentiment.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2424

2525
# Create an API instance
2626
api = API(user_key=key, service_url=alt_url)
27+
# Set selected API options.
28+
# For more information on the functionality of these
29+
# and other available options, see Rosette Features & Functions
30+
# https://developer.rosette.com/features-and-functions#sentiment-analysis
31+
32+
# api.set_option('modelType','dnn') #Valid for English only
2733

2834
params = DocumentParameters()
2935
params["language"] = "eng"

examples/tokens.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
1818

19+
# Set selected API options.
20+
# For more information on the functionality of these
21+
# and other available options, see Rosette Features & Functions
22+
# https://developer.rosette.com/features-and-functions#tokenization
23+
24+
# api.set_option('modelType','perceptron') #Valid for Chinese and Japanese only
25+
1926
tokens_data = "北京大学生物系主任办公室内部会议"
2027
params = DocumentParameters()
2128
params["content"] = tokens_data

examples/topics.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1616
# Create an API instance
1717
api = API(user_key=key, service_url=alt_url)
1818

19+
# Set selected API options.
20+
# For more information on the functionality of these
21+
# and other available options, see Rosette Features & Functions
22+
# https://developer.rosette.com/features-and-functions#topic-extraction
23+
24+
# api.set_option('keyphraseSalienceThreshold','.5')
25+
# api.set_option('conceptSalienceThreshold','.1')
26+
1927
topics_data = "Lily Collins is in talks to join Nicholas Hoult in Chernin Entertainment and Fox Searchlight's J.R.R. Tolkien biopic Tolkien. Anthony Boyle, known for playing Scorpius Malfoy in the British play Harry Potter and the Cursed Child, also has signed on for the film centered on the famed author. In Tolkien, Hoult will play the author of the Hobbit and Lord of the Rings book series that were later adapted into two Hollywood trilogies from Peter Jackson. Dome Karukoski is directing the project."
2028
params = DocumentParameters()
2129
params["content"] = topics_data

0 commit comments

Comments
 (0)