cognitive-catalyst / WA-Testing-Tool

Scripts that run against Watson Assistant for K fold validation on training set, testing on blind test, and draw precision curves for comparison.
Apache License 2.0
78 stars 60 forks source link

#216 updates to use NLU instead of NLC, from Andrew Freed and Keith H… #223

Closed andrewrfreed closed 1 year ago

andrewrfreed commented 1 year ago

216 updates to use NLU instead of NLC, from Andrew Freed and Keith Hammock Keith.Hammock@ibm.com

Signed-off-by: Andrew R Freed afreed@us.ibm.com

Commit set 1 is based on Python 3.9.x requirements from Watson SDK. May require updates so that it runs on older Pythons like 3.7.x. One issue reported with Watson SDK team that some imports don't resolve in older python:

from ibm_watson.natural_language_understanding_v1 import ClassificationOptions
from ibm_watson.natural_language_understanding_v1 import Features

Without resolution, the testing error looks like:

Traceback (most recent call last):
  File "/Users/afreed/Code/workspace-ibm-ghe/WA-Testing-Tool/utils/testNLC.py", line 29, in <module>
    from ibm_watson.natural_language_understanding_v1 import ClassificationOptions
ImportError: cannot import name 'ClassificationOptions' from 'ibm_watson.natural_language_understanding_v1' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ibm_watson/natural_language_understanding_v1.py)

Need to have this resolved before merging this change set.

kfhammock commented 1 year ago

Tested changes made by Andred R Freed to training and testing an NLU model; all of the tests passed.

Previously, from ibm_watson import NaturalLanguageClassifierV1 was updated to from ibm_watson import NaturalLanguageUnderstandingV1. All of the corresponding function calls were updated as well.