Skip to content

Commit 319a7a1

Browse files
[concept insights] added list corpora for a given account fixes #65
1 parent 6599fa5 commit 319a7a1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/concept_insights_v2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
corpora = concept_insights.list_corpora()
3333
print (json.dumps(corpora, indent=2))
3434

35+
corpora = concept_insights.list_corpora(account='public')
36+
print (json.dumps(corpora, indent=2))
37+
38+
3539
corpus = concept_insights.get_corpus('ibmresearcher', account='public')
3640
print(json.dumps(corpus, indent=2))
3741

watson_developer_cloud/concept_insights_v2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ def annotate_text(self, text, graph=WIKIPEDIA_EN_LATEST):
9595
return self.request(method='POST', url='/v2/{0}/annotate_text'.format(graph), data=text,
9696
headers={'content-type': 'text/plain'}, accept_json=True)
9797

98-
def list_corpora(self):
99-
return self.request(method='GET', url='/v2/corpora', accept_json=True)
98+
def list_corpora(self, account=None):
99+
return self.request(method='GET', url='/v2/corpora/{0}'.format(account), accept_json=True)
100100

101101
def _get_full_corpus_path(self, corpus, account=None):
102102
if corpus.count('/') == 3:

0 commit comments

Comments
 (0)