Skip to content

Commit 1bcdea5

Browse files
author
Adam Soos
committed
WS-3314: update examples
1 parent ce6e29c commit 1bcdea5

28 files changed

Lines changed: 140 additions & 140 deletions

examples/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
## Endpoint Examples
22

3-
Each example file demonstrates one of the capabilities of the Rosette Platform.
3+
Each example file demonstrates one of the capabilities of the Babel Street Analytics Platform.
44

55
Here are some methods for running the examples. Each example will also accept an optional `--url` parameter for
66
overriding the default URL.
77

8-
A note on prerequisites. Rosette API only supports TLS 1.2 so ensure your toolchain also supports it.
8+
A note on prerequisites. Analytics API only supports TLS 1.2 so ensure your toolchain also supports it.
99

1010
#### Virtualenv/Latest Release
1111
```
1212
git clone git@github.com:rosette-api/python.git
1313
cd python/examples
14-
virtualenv rosette_venv
15-
source rosette_venv/bin/activate
14+
virtualenv analytics_venv
15+
source analytics_venv/bin/activate
1616
pip install rosette_api
1717
python ping.py -k $API_KEY
1818
```
@@ -21,8 +21,8 @@ python ping.py -k $API_KEY
2121
```
2222
git clone git@github.com:rosette-api/python.git
2323
cd python
24-
virtualenv rosette_venv
25-
source rosette_venv/bin/activate
24+
virtualenv analytics_venv
25+
source analytics_venv/bin/activate
2626
python setup.py install
2727
cd examples
2828
python ping.py -k $API_KEY

examples/address_similarity.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to get match score (similarity) of two addresses.
3+
Example code to call Analytics API to get match score (similarity) of two addresses.
44
"""
55

66
import argparse
@@ -10,7 +10,7 @@
1010
from rosette.api import API, AddressSimilarityParameters, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
@@ -29,9 +29,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2929
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
3030
description='Calls the ' +
3131
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
32-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
32+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
3333
PARSER.add_argument('-u', '--url', help="Alternative API URL",
34-
default='https://api.rosette.com/rest/v1/')
34+
default='https://analytics.babelstreet.com/rest/v1/')
3535

3636
if __name__ == '__main__':
3737
ARGS = PARSER.parse_args()

examples/categories.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
"""
4-
Example code to call Rosette API to get the category of a document (at a given URL).
4+
Example code to call Analytics API to get the category of a document (at a given URL).
55
"""
66

77
import argparse
@@ -12,16 +12,16 @@
1212
from rosette.api import API, DocumentParameters, RosetteException
1313

1414

15-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
15+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1616
""" Run the example """
1717
categories_text_data = "If you are a fan of the British television series Downton Abbey and you are planning to be in New York anytime before April 2nd, there is a perfect stop for you while in town."
1818
# Create an API instance
1919
api = API(user_key=key, service_url=alt_url)
2020

2121
# Set selected API options
2222
# For more information on the functionality of these
23-
# and other available options, see Rosette Features & Functions
24-
# https://developer.rosette.com/features-and-functions#categorization
23+
# and other available options, see Analytics Features & Functions
24+
# https://developer.babelstreet.com/features-and-functions#categorization
2525

2626
# api.set_option('singleLabel', 'true')
2727
# api.set_option('scoreThreshold',- 0.20)
@@ -38,9 +38,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3838
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
3939
description='Calls the ' +
4040
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
41-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
41+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
4242
PARSER.add_argument('-u', '--url', help="Alternative API URL",
43-
default='https://api.rosette.com/rest/v1/')
43+
default='https://analytics.babelstreet.com/rest/v1/')
4444

4545
if __name__ == '__main__':
4646
ARGS = PARSER.parse_args()

examples/entities.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to get entities from a piece of text.
3+
Example code to call Analytics API to get entities from a piece of text.
44
"""
55

66
import argparse
@@ -10,15 +10,15 @@
1010
from rosette.api import API, DocumentParameters, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
1717

1818
# Set selected API options.
1919
# 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#entity-extraction-and-linking
20+
# and other available options, see Analytics Features & Functions
21+
# https://developer.babelstreet.com/features-and-functions#entity-extraction-and-linking
2222

2323
# api.set_option('calculateSalience','true')
2424
# api.set_option('linkEntities','false')
@@ -36,9 +36,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3636
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
3737
description='Calls the ' +
3838
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
39-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
39+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
4040
PARSER.add_argument('-u', '--url', help="Alternative API URL",
41-
default='https://api.rosette.com/rest/v1/')
41+
default='https://analytics.babelstreet.com/rest/v1/')
4242

4343
if __name__ == '__main__':
4444
ARGS = PARSER.parse_args()

examples/events.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to get events from a piece of text.
3+
Example code to call Analytics API to get events from a piece of text.
44
"""
55

66
import argparse
@@ -10,7 +10,7 @@
1010
from rosette.api import API, DocumentParameters, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
@@ -27,9 +27,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2727
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
2828
description='Calls the ' +
2929
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
30-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
30+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
3131
PARSER.add_argument('-u', '--url', help="Alternative API URL",
32-
default='https://api.rosette.com/rest/v1/')
32+
default='https://analytics.babelstreet.com/rest/v1/')
3333

3434
if __name__ == '__main__':
3535
ARGS = PARSER.parse_args()

examples/events_negation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to get events, based on a set negation option, from a piece of text.
3+
Example code to call Analytics API to get events, based on a set negation option, from a piece of text.
44
"""
55

66
import argparse
@@ -10,7 +10,7 @@
1010
from rosette.api import API, DocumentParameters, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
@@ -31,9 +31,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3131
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
3232
description='Calls the ' +
3333
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
34-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
34+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
3535
PARSER.add_argument('-u', '--url', help="Alternative API URL",
36-
default='https://api.rosette.com/rest/v1/')
36+
default='https://analytics.babelstreet.com/rest/v1/')
3737

3838
if __name__ == '__main__':
3939
ARGS = PARSER.parse_args()

examples/info.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to get information such as version and build
3+
Example code to call Analytics API to get information such as version and build
44
"""
55

66
import argparse
@@ -10,7 +10,7 @@
1010
from rosette.api import API, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
@@ -24,9 +24,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2424
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
2525
description='Calls the ' +
2626
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
27-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
27+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
2828
PARSER.add_argument('-u', '--url', help="Alternative API URL",
29-
default='https://api.rosette.com/rest/v1/')
29+
default='https://analytics.babelstreet.com/rest/v1/')
3030

3131
if __name__ == '__main__':
3232
ARGS = PARSER.parse_args()

examples/language.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to determine the language of a piece of text.
3+
Example code to call Analytics API to determine the language of a piece of text.
44
"""
55

66
import argparse
@@ -10,7 +10,7 @@
1010
from rosette.api import API, DocumentParameters, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
@@ -28,9 +28,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2828
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
2929
description='Calls the ' +
3030
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
31-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
31+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
3232
PARSER.add_argument('-u', '--url', help="Alternative API URL",
33-
default='https://api.rosette.com/rest/v1/')
33+
default='https://analytics.babelstreet.com/rest/v1/')
3434

3535
if __name__ == '__main__':
3636
ARGS = PARSER.parse_args()

examples/language_multilingual.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to determine the language of a piece of text.
3+
Example code to call Analytics API to determine the language of a piece of text.
44
"""
55

66
import argparse
@@ -10,7 +10,7 @@
1010
from rosette.api import API, DocumentParameters, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
@@ -30,9 +30,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3030
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
3131
description='Calls the ' +
3232
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
33-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
33+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
3434
PARSER.add_argument('-u', '--url', help="Alternative API URL",
35-
default='https://api.rosette.com/rest/v1/')
35+
default='https://analytics.babelstreet.com/rest/v1/')
3636

3737
if __name__ == '__main__':
3838
ARGS = PARSER.parse_args()

examples/morphology_complete.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Example code to call Rosette API to get the complete morphological analysis of a piece of text.
3+
Example code to call Analytics API to get the complete morphological analysis of a piece of text.
44
"""
55

66
import argparse
@@ -10,15 +10,15 @@
1010
from rosette.api import API, DocumentParameters, RosetteException
1111

1212

13-
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
13+
def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
1414
""" Run the example """
1515
# Create an API instance
1616
api = API(user_key=key, service_url=alt_url)
1717

1818
# Set selected API options.
1919
# 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
20+
# and other available options, see Analytics Features & Functions
21+
# https://developer.babelstreet.com/features-and-functions#morphological-analysis-introduction
2222

2323
# api.set_option('modelType','perceptron') #Valid for Chinese and Japanese only
2424

@@ -34,9 +34,9 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
3434
PARSER = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
3535
description='Calls the ' +
3636
os.path.splitext(os.path.basename(__file__))[0] + ' endpoint')
37-
PARSER.add_argument('-k', '--key', help='Rosette API Key', required=True)
37+
PARSER.add_argument('-k', '--key', help='Analytics API Key', required=True)
3838
PARSER.add_argument('-u', '--url', help="Alternative API URL",
39-
default='https://api.rosette.com/rest/v1/')
39+
default='https://analytics.babelstreet.com/rest/v1/')
4040

4141
if __name__ == '__main__':
4242
ARGS = PARSER.parse_args()

0 commit comments

Comments
 (0)