Reputation: 131
I have two entities called @amount and @type . @type has values like "A1BM", "C3MH" and @amount has values such as "1,2,3,4,5,6,7,8,9,10" . Whenever the user enters "A1BM 10", I want the bot to recognize that "10" not as an @amount but rather as the size of the @type.
How can I do it?
Upvotes: 2
Views: 221
Reputation: 17156
You can use patterns (regular expressions) to define entities, e.g., for the format of @amount. Watson Assistant also has system entities that can be enabled, e.g., @sys-number for detecting different forms and written formats of numbers. Moreover, when checking for matches you can also access the entire input string, locations of detected objects (intents, entities, ...) and the confidence of a detection.
You did not share details about how the responses will be entered. Your best bet seems to me to add a pattern for @type, use a number pattern or @sys-number for @amount and compare the location and relative neighborhood of entered values to detect that "10" is meant as size and not as amount.
There are some examples in the documentation.
Upvotes: 2