Using a custom model in NLU
Once you have deployed a model to your NLU instance, you can reference that model in the feature attributes for either entities or relations (or both).
The following are the steps:
- You need the Model ID, which you can get through the
List models
method on the NLU service, or more easily from theModel ID
listed in theVersion History and Deployment
tab of Knowledge Studio:
- Reference that
model
ID in your call to the analyze method:
entities=EntitiesOptions(limit=100, mentions=True, sentiment=True, emotion=True, model='7a8d0323-939b-4dbc-afa8-1a60d7966c67')
- When you run the analyze method again with this model, you should see dramatically different results than the entity analysis. It might look something like this:
The following entities were found: [British] of type <ORGANIZATION> was found 1 times, with 0% confidence. The entity was found in: "British", at index 55 The emotional scores for this entity are: 12% Anger; 2% Disgust; 15% Fear; 63% Joy; and 3% Sadness...