pythonibm-cloudibm-watsonwatson-nlu

Not able to find out the IBM NLU latest syntax for Python


I am trying to connect IBM Watson NLU using python but below code is outdated because today I have created the new resource group for the IBM NLU then I tried to find out the credentials but I didn't get the username and password.

There are new things. Please check the below image.

enter image description here

    natural_language_understanding = NaturalLanguageUnderstandingV1(
        url=<URL>,
        version='2018-03-16',
        username=<UserName>,
        password=<Password>)

    natural_language_understanding.disable_SSL_verification()
    try:
        response = natural_language_understanding.analyze(
            text=str(user_answer_sent),
            features=Features(
                semantic_roles=SemanticRolesOptions(),
                sentiment=SentimentOptions()
            ), language='en'
        ).get_result()

I am not able to find out the latest syntax for IBM Watson NLU. Please let me know if you have then I will try it.


Solution

  • There are additional examples and more information in the API reference.