In my chatbot, i want to extract the first name with an intent “introduction”. I have created an entity “first_name” and a slot “first name” with the type text, to store it.
But when i talk with my chatbot, it detect 2 times the first name :
exemples:
intent: introduction # predicted: introduction: Hello my name is MickMick
@A2F Check your domain file, may be you mentioned link two times? If not delete the older trained models and re-train and try. If not do share some related files for the same.
Thanks you for the help. I have try to delete the older trained models and re-train but it doesn’t work. And for the domain file i don’t think i’m doing something wrong.
I have the entity and the slots:
And in my nlu.yml i define a lookup table with a list of name :
And define an intent : introduction
And when i write a storie for a test :
Hello my name is [Kevin](first_name)
The output is :
predicted: introduction: Hello my name is [Kevin](first_name)[Kevin](first_name)
Try this, first and we use slot_was_set when we want to set the by default value in slots, else it should be null, because we entering by user input i.e text as you mentioned in type, under slots.
Please check this story and do let me know, as I don’t have complete code, this code can have error, but still try.
Next time, do mention @ with my name nik202 for getting direct notifications. Thanks.
When I run my tests, some of them work well and extract only 1 time the first_name entity. But others tests don’t pass and extract 2 times the first name entity.
steps:
- intent: introduction # predicted: introduction: Hello my name is [Afif](first_name)[Afif](first_name)
entities:
- first_name: Afif
- slot_was_set:
- first_name: Afif
It only appear for some name. And of course, i always delete all the model before train my chatbot.
Just to know, when you extract an entity, it stores the value in the corresponding slot normally ?
Because i don’t really understand why i have to change my stories without slot_was_set.
I tried to show more information about the extraction of the first name.
And it seems that the DIETClassifor extractor extracts the first name once and the RegexExtractor, extracts it a second time.
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to
train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
- name: WhitespaceTokenizer
- name: RegexEntityExtractor
case_sensitive: False
use_lookup_tables: True
use_regexes: True
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: char_wb
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 200
constrain_similarities: true
- name: EntitySynonymMapper
- name: ResponseSelector
epochs: 200
constrain_similarities: true
# - name: FallbackClassifier
# threshold: 0.3
# ambiguity_threshold: 0.1
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# # No configuration for policies was provided. The following default policies were used to train your model.
# # If you'd like to customize them, uncomment and adjust the policies.
# # See https://rasa.com/docs/rasa/policies for more information.
- name: RulePolicy
- name: FormPolicy
- name: MemoizationPolicy
- name: TEDPolicy
max_history: 5
epochs: 200
constrain_similarities: true