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
131 stars 43 forks source link

TypeError: 'DetailedResponse' object is not subscriptable #17

Closed anubhabmondalDirac closed 1 year ago

anubhabmondalDirac commented 2 years ago

First, i can't authenticate in IBM Watson NLU using username and password then i used ibm_watson instead of watson_developer_cloud. Now everything runs fine but in classify_text(text,config) i am getting that error TypeError: 'DetailedResponse' object is not subscriptable.

I also see a few suggestions to upgrade watson_developer_cloud but if use that library then I can't find how to authenticate in IBM Watson NLU using username and password. I hope you understand my problem.

Can someone please help me on this? That would be very helpful. @jjasghar @animeshsingh @kant @krook @christo4ferris

csgorham commented 2 years ago

  import Features, EntitiesOptions, SemanticRolesOptions, RelationsOptions, KeywordsOptions

from ibm_cloud_sdk_core.authenticators import IAMAuthenticator,CloudPakForDataAuthenticator

nlu_apikey= ***'
nlu_url = '***'
authenticator = IAMAuthenticator(nlu_apikey)

natural_language_understanding = NaturalLanguageUnderstandingV1( version='2022-07-26',authenticator=authenticator)

natural_language_understanding.set_service_url(nlu_url) 
csgorham commented 2 years ago

I also have the 'detailed response is not subscriptable' error... and 'File is not a zip file'

anubhabmondalDirac commented 1 year ago

thanks @csgorham