Skip to content

Commit 0724bab

Browse files
committed
adding custom classifiers to alchemy entities
1 parent 57dcbf9 commit 0724bab

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

examples/visual_recognition_v3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
# print(json.dumps(visual_recognition.get_classifier('YOUR CLASSIFIER ID'), indent=2))
2020

21-
with open('../resources/car.jpg', 'rb') as image_file:
22-
print(json.dumps(visual_recognition.update_classifier('CarsvsTrucks_1479118188',
23-
cars_positive_examples=image_file), indent=2))
21+
# with open(join(dirname(__file__), '../resources/car.jpg'), 'rb') as image_file:
22+
# print(json.dumps(visual_recognition.update_classifier('CarsvsTrucks_1479118188',
23+
# cars_positive_examples=image_file), indent=2))
2424

2525
print(json.dumps(visual_recognition.classify(images_url=test_url), indent=2))
2626

watson_developer_cloud/alchemy_language_v1.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ def concepts(self, html=None, text=None, url=None, max_items=8, linked_data=True
5151
return self._alchemy_html_request('GetRankedConcepts', html=html, text=text, url=url, params=params)
5252

5353
def entities(self, html=None, text=None, url=None, disambiguate=True, linked_data=True, coreference=True,
54-
quotations=False, sentiment=False, show_source_text=False, max_items=50, language=None):
54+
quotations=False, sentiment=False, show_source_text=False, max_items=50, language=None, model=None):
5555
params = {'disambiguate': disambiguate,
5656
'linkedData': linked_data,
5757
'coreference': coreference,
5858
'quotations': quotations,
5959
'sentiment': sentiment,
6060
'showSourceText': show_source_text,
6161
'maxRetrieve': max_items,
62-
'language': language}
62+
'language': language,
63+
'model': model}
6364
return self._alchemy_html_request('GetRankedNamedEntities', html=html, text=text, url=url, params=params)
6465

6566
def emotion(self, html=None, text=None, url=None, show_source_text=False, source_text_type=None,

0 commit comments

Comments
 (0)