IBM / build-knowledge-base-with-domain-specific-documents

Create a knowledge base using domain specific documents and the mammoth python library
https://developer.ibm.com/patterns/build-a-domain-specific-knowledge-graph-from-given-set-of-documents/
Apache License 2.0
132 stars 43 forks source link

Bug in calling NLU Service #7

Open sumitdua10 opened 6 years ago

sumitdua10 commented 6 years ago

I ran the code but it gave error - responsejson is not subscriptable.

I updated the last line of function analyze_using_NLU(text_content) which resolved the issue

Existing Line: return response

Updated Line: return response.get_result() def analyze_using_NLU(text_content): ''' Call Watson Natural Language Understanding service to obtain analysis results. ''' response = natural_language_understanding.analyze( text= text_content, features=Features( entities=EntitiesOptions(), relations=RelationsOptions(), keywords= KeywordsOptions()) ) return response.get_result()

Neha-Setia commented 6 years ago

Hi @sumitdua10 I have updated the Notebook. There are some changes with the latest version of the Watson Developer Cloud. So instead of !pip install --upgrade watson-developer-cloud change to !pip install watson-developer-cloud==1.5. It should work :)

screen shot 2018-09-28 at 11 31 35 am