Hi Sam,
Agreed, creating thousands of examples is a terrible idea!
I went down the “lookup” route which is a case-insensitive RegEx route (according to the docs). I would like to ask though if this is expected behaviour …
- Created a simple entity marked up with a city entity
- Created a list of cities in a lookup
- intent: what_is_weather_like
examples: |
- lookup: city
examples: |
- berlin
- london
- stockholm
- barcelona
- rome
- madrid
- worcester
- gloucester
- birmingham
- cheltenham
- chelters
- chelts
This works ok but I can’t use synonyms to normalize, so I do that in my validation_city method instead for the slot. This works fine (with a little bit of work but it works great!).
However, even though I have trained the entity city to appear late on in my intent examples, I get this response for the input “berlin whats the weather like in cheltenham”
"text": "berlin whats the weather like in cheltenham",
"intent": {
"id": 8382829466045491448,
"name": "what_is_weather_like",
"confidence": 0.983062207698822
},
"entities": [
{
"entity": "city",
"start": 0,
"end": 6,
"value": "berlin",
"extractor": "RegexEntityExtractor"
},
{
"entity": "city",
"start": 33,
"end": 43,
"value": "cheltenham",
"extractor": "RegexEntityExtractor"
},
{
"entity": "city",
"start": 0,
"end": 6,
"confidence_entity": 0.9866355061531067,
"value": "berlin",
"extractor": "DIETClassifier"
}
Note how the DIETClassifier doesn’t pick up “cheltenham” but “berlin”. Using lookups are there any point to placing entities in intent data? I would have expected the classifier to pick up the second city, not the first (based on my training examples).
Can you guide? Apologise if these seem rudimentary but intent and accurate entity extraction are key to what I am working on.
Thanks Sam!