Problem : extract 2 times the first name

Hello everyone,

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

Someone has an idea ?

@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: image

And in my nlu.yml i define a lookup table with a list of name :

image

And define an intent : introduction image

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)

@A2F Where is your domain.yml ?

utter_introduction in response where you passed this response output

"Hello my name is …

That’s how i use the first name :

responses:
  utter_accueil:
  - text: hello {first_name} ! how can i help you ?

And my domain.yml is inside my project folder.

story:

intent: introduction
entities:
 first_name: Afif
slot_was_set:
- first_name: Afif

Maybe it’s the lookup table or the extractor i use. I have no idea what the problem is

@A2F You story is not correct:

- story :  introduction
  steps: 
  - intent: greet
  - action: utter_greet
  - intent: introduction
    entities:
    - first_name: "Atif"
  - action: utter_accueil

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.

@nik202 Hello,

I have done what you suggested and don’t use slot_was_set, but it seems that it doesn’t work (the code run).

Storie:

steps:
- intent: greet
- action: utter_greet
- intent: introduction
entities:
- first_name: Afif
#- slot_was_set:
#  - first_name: Afif

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.

Test → ok :

- intent: introduction
  entities:
     - first_name: Jules
- slot_was_set:
  - first_name: Jules

test → ko :

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.

Thank you again for the help

@nik202 Hi,

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.

@A2F Please share config.yml

@A2F try use rasa interactive and tell me what you observe

@nik202

# 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