Intent is classified correctly but the entity recognized is not matching

The intent is identified accurately, but there is a discrepancy in the recognized entity. My issue is I have a user response where he provides his postal zipcode and the bot is identifying the intent correctly but the entity is getting misclassified.

You can see the following for reference

“response”:{ { “event”: “user”, “text”: “My postal code, as in the mailing zip, is 34567.”, “parse_data”: { “intent”: { “name”: “inform_mailing_zip”, “confidence”: 0.967684268951416 }, “entities”: [ { “entity”: “policy_number”, “start”: 42, “end”: 47, “confidence_entity”: 0.23964835703372955, “value”: “34567”, “extractor”: “DIETClassifier” } ], “text”: “My postal code, as in the mailing zip, is 34567.”,

    "intent_ranking": [
      {
        "name": "inform_mailing_zip",
        "confidence": 0.967684268951416
      },
      {
        "name": "inform_policy_number",
        "confidence": 0.01124406699091196
      },
      {
        "name": "inform_dob",
        "confidence": 0.0022329019848257303
      },
      {
        "name": "inform_preferred_contact",
        "confidence": 0.0022209070157259703
      },
      {
        "name": "inform_group_id",
        "confidence": 0.0017992813372984529
      },
      {
        "name": "emergency_contact_name",
        "confidence": 0.0014402118977159262
      },
      {
        "name": "submit_pi",
        "confidence": 0.0014140320708975196
      },
      {
        "name": "inform_gender",
        "confidence": 0.0012727619614452124
      },
      {
        "name": "stop",
        "confidence": 0.0010364839108660817
      },
      {
        "name": "inform_primary_insurance_provider",
        "confidence": 0.0009016144322231412
      }
    ],
    "response_selector": {
      "all_retrieval_intents": [],
      "default": {
        "response": {
          "responses": null,
          "confidence": 0,
          "intent_response_key": null,
          "utter_action": "utter_None"
        },
        "ranking": []
      }
    }
  },
  "input_channel": "cmdline",
  "message_id": "3231acc20b3d4af3ab8fea714595f357"
},

I think there might be problem in your configh.yml, there are tools for extracting entities, maybie you forgot to add something that is responsible for exctracting entity? you created correct way to ask bot, so it clasyfie user intent, but there is no mechanizm to extract that entity? if config.yml is correct follow your entity, is it added in domain.yml and all of it is created correctly?

I am using in my config.yml “DIETClassifier”, it is responsible for entity extraction: Components (rasa.com)

pipeline:
    - name: DIETClassifier
      epochs: 100
      constrain_similarities: True

This is my config.yml file

pipeline:
  - name: "SpacyNLP"
    model: "en_core_web_md"
    case_sensitive: False
  - name: "SpacyTokenizer"
    case_sensitive: False
  - name: "SpacyFeaturizer"
  - name: "RegexFeaturizer"
  - name: "LexicalSyntacticFeaturizer"
  - name: "LanguageModelFeaturizer"
    model_name: "bert"
    model_weights: "rasa/LaBSE"
  - name: "CountVectorsFeaturizer"
    analyzer: "char_wb"
    min_ngram: 2
    max_ngram: 4
  - name: "DIETClassifier"
    epochs: 100
    random_seed: 2
    constrain_similarities: true
    model_confidence: softmax
  - name: "EntitySynonymMapper"
  - name: "ResponseSelector"
    epochs: 100
    random_seed: 2
  - name: FallbackClassifier
    threshold: 0.3
    ambiguity_threshold: 0.1

you are sure, you did not forgot anything? in domain.yml there should be:

entities:
    - myCoolEntity

in stories.yml when you have “intent” there can be explicit intent that you are using

- story: order in restaurant
  steps:
  - intent: greet
  - action: utter_greet
  - intent: order
    entities:
      - Restaurant: "My Cool Restaurant"
  - action: action_recommended_restaurant

in nlu.yml:

- intent: inform
  examples: |
    - my account number is [1234567891](account_number)

please take a look in those 2 links: NLU Training Data (rasa.com) & Entities – Rasa Learning Center

Just wanted to inform I am using Rasa forms Also I have defined the slot mappings and story correctly. But I am unable to figure out the error. This is a similar issue I am facing Intent classification with wrong intent - Rasa Open Source - Rasa Community Forum

well, I responded in that question, for that guy I understand a problem about classifying 2 similar things in 2 groups, my solution for him was to use Roles&Groups but I am not understanding your problem right now :confused: