Natural language enabled chatbots are using some kind of NLP engine in the background to recognize intents and entities for the user input. This information is not shown to the user directly. It may make sense to assert for the recognized intents and entities instead of the text response of the chatbot - or you can even use it in parallel (assert text and intent confidence for example).
Some NLP engines, such as Microsoft Luis, do not manage conversation flow and only provide NLP analysis (like intent and entity recognition). For these engines, you can't verify the response content (like text or buttons); you can only check the NLP analysis using NLP Asserters.
You can use NLP Asserters to gather statistics by comparing expected results with the actual responses from the NLP engine.
NLP Intent
INTENT (arguments: intent name to look out for), used in #bot section, will assert that bot answered with the specified intent.
NLP Intent Confidence
INTENT_CONFIDENCE (arguments: minimal accepted confidence, like “70” for 70%), used in #bot section, will assert that bot answered with at least the specified minimal confidence.
NLP Entity
ENTITIES (arguments: expected entities like “from|to”, or minimal entities like “from|…” ), used in #bot section, will assert that bot answered with the specified entities.
NLP Entity Values
ENTITY_VALUES (arguments: expected entity values like “2018|2019”, or minimal entity values like “2018|…” ), used in #bot section, will assert that bot answered with the specified entity values.
NLP Entity Content
ENTITY_CONTENT (arguments: entity and expected values like location|Budapest|Vienna)
-
One ENTITY_CONTENT asserter checks only one entity. Use more asserters to check more.
-
Does not fail if the response has more values as specified in arguments.
Example Botium Scripts
#me
please send me two salami pizza
#bot
INTENT I_ORDER_PIZZA
INTENT_CONFIDENCE 70
ENTITIES E_PIZZA_TYPE|E_FOOD
ENTITY_VALUES salami|pizza
Please select the size of the pizza
#me
I want to travel from Berlin to Vienna.
#bot
Im happy to hear it. And where are you now?
INTENT travel
#me
in Münich.
#bot
So you are in Münich, and want to travel from Berlin to Vienna?
You will travel to Berlin on your own?
INTENT travel
ENTITY_VALUES Berlin|Vienna|Münich
...
ENTITY_CONTENT FROM|Berlin
ENTITY_CONTENT TO|Vienna
ENTITY_CONTENT LOCATION|Münich
Using the Intent Confidence Asserter globally
{
"botium": {
"Capabilities": {
...
"ASSERTERS": [
{
"ref": "INTENT_CONFIDENCE",
"src": "IntentConfidenceAsserter",
"global": true,
"args": {
"expectedMinimum": 80
}
}
]
}
}
}