I am practicing setting the response with variables. Using the example of rasa init, I have modified the following places. The result is that the user input is exactly the same as the entities of the intent before it can be recognized. If it is not the same, it will be replaced by non.
I’m not sure I understand your question? Do you mean that the named entity recognition only works with the names “Gerry”, “Tom” and “Alice”, which are present in your NLU data?
The Named entity recognition “component” of the NLU model is trained on your training data, just like for intent classification. In your case, your model has been trained on just 3 examples of the entity name, which is very little. If you want it to perform better for something as diverse as name, you’ll have to include a lot more examples.
For something like name, I would probably choose to use a pre-trained entity extractor like Spacy for the entity PERSON.
Hi,
Make sure Spacy is installed (Installation), then
you’ll need to set SpacyNLP (Components) and SpacyEntityExtractor (Components) in the config.yml. It’ll look something like that:
pipeline:
- name: "SpacyNLP"
# language model to load
model: "en_core_web_md"
case_sensitive: False
# Maybe some other components...
- name: "SpacyEntityExtractor"
# dimensions to extract
dimensions: ["PERSON"]
# Maybe some other components...
Then add the entity in your domain:
entities:
- PERSON
If you want to use the entity in responses, you’ll have to define a slot, with its mappings. It’s good to read the relevant docs (Domain), it’s easy to get confused with them when first starting out
entities:
- PERSON
slots:
name:
type: any
influence_conversation: false
mappings:
- type: from_entity
entity: PERSON
responses:
utter_greet:
- text: "Hey, {name}. How are you?"
Is it because the sample is too small, or is it some other reason?