Understanding the concepts
How the intent condition is evaluated
- any of listed intents are matching
 - all of listed entity conditions are matching
 
So the condition could look like this
( [entity-1] AND [entity-2] ) AND ( [intent-1] OR [intent-2] )
The closest match wins
If there is more then one matching conditions, the closest one wins. Also in 2.xx version bots the sophisticated conditions should be above the less complex conditions.
Also if the difference is too big (lot of additional redundant entities), there'll be no match.
How the matching score is calculated
Let's have a following intent and some entities matched:
{"intent": "travel","score": 0.9,"entites": [{"entity": "destination","value": "Prague","score": 1.0}]}
And let's have theese three interactions with following conditions
entities:
@destinationand@transportType, intent:travelThis interaction is not matching, because there's
@transportTypesentity missing.entities: optional
@transportType?, intent:travelThis interaction is matching, but:
- there'll be little penalisation (0.001) for missing optional entity 
@transportType - there'll be penalisation (0.05) for redundant recognized entity 
@destination 
- there'll be little penalisation (0.001) for missing optional entity 
 entities:
@destination, intent:travelThis interaction is fully matching and there'll be no penalisation.
intent:
travelThis interaction is matching, but:
- there'll be penalisation (0.05) for redundant recognized entity 
@destination 
- there'll be penalisation (0.05) for redundant recognized entity 
 just entity:
@destinationThis interaction is matching, but:
- there'll be penalisation (0.15) for redundant recognized intent 
travel 
- there'll be penalisation (0.15) for redundant recognized intent 
 
An entity extends the utterance
An utterance should keep its meaning while replacing the marked entity with it’s values.
The bot should be ready to answer all entity combinations
There should be an interaction for all possible combinations of entities used in intent utterances.
Best practices for building the training data
before creating new intent
- use the NLP tester to ensure there is not already similar intent
 
when adding utterance examples
always add at least a pair of examples
example:
I need a breakandI want a breakif a word could be omitted, add another example
example when adding
I need a breakadd alsoI need breakandneed breakcombine short examples with long examples (use your imagination)
example:
need coffeeandi need a coffee pleasean intent should have at least 10 utterances