WA-Testing-Tool icon indicating copy to clipboard operation
WA-Testing-Tool copied to clipboard

Reference to NaturalLanguageClassifierV1 should be updated or removed

Open andrewrfreed opened this issue 2 years ago • 1 comments

$ python3 run.py -c config.ini
Traceback (most recent call last):
 File "run.py", line 27, in <module>
  from ibm_watson import NaturalLanguageClassifierV1
ImportError: cannot import name 'NaturalLanguageClassifierV1' from 'ibm_watson' (/Users/Default/Library/Python/3.8/lib/python/site-packages/ibm_watson/__init__.py)

https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-about

On 9 August 2021, IBM announced the deprecation of the IBM Watson™ Natural Language Classifier service. The service will no longer be available from 8 August 2022. As of 9 September 2021, you will not be able to create new instances. Existing instances will be supported until 8 August 2022. Any instance that still exists on that date will be deleted. As an alternative, we encourage you to consider migrating to the IBM Watson™ Natural Language Understanding service on IBM Cloud that uses deep learning to extract data and insights from text such as keywords, categories, sentiment, emotion, and syntax, along with advanced multi-label text classification capabilities, to provide even richer insights for your business or industry. For more information, see migrating to IBM Watson™ Natural Language Understanding.

Check if there is a new import that should be used instead or if references should be removed.

andrewrfreed avatar Aug 04 '22 12:08 andrewrfreed

It looks like the updated import is NaturalLanguageUnderstandingV1, possibly the other NLC-specific methods need refactoring.

https://github.com/watson-developer-cloud/python-sdk/blob/master/ibm_watson/natural_language_understanding_v1.py#L49

andrewrfreed avatar Aug 04 '22 12:08 andrewrfreed

Multiple updates in place and enough NLU function is updated that the WA path works. Still waiting confirmation on NLU capability in various Python flavors.

andrewrfreed avatar Dec 20 '22 21:12 andrewrfreed

Had Slack discussion w/ Keith on testing, this capability works in most recent Python versions. There is an SDK issue on NLU on older Python versions; workaround is use Python 3.9+ if using NLU to classify.

andrewrfreed avatar Jan 11 '23 15:01 andrewrfreed

Additional info on need for newer Python version when using NLU: https://github.com/watson-developer-cloud/python-sdk/issues/827

andrewrfreed avatar Jan 13 '23 15:01 andrewrfreed