How to extract entity with RASA NLU

Rasa NLU version:0.13.6

Operating system (windows, osx, …):windows

Content of model configuration file:


language: "en"

pipeline:
- name: tokenizer_whitespace
- name: intent_entity_featurizer_regex
- name: ner_crf
- name: ner_synonyms
- name: intent_featurizer_count_vectors
- name: intent_classifier_tensorflow_embedding
  intent_tokenization_flag: true
  intent_split_symbol: "+"
path: ./models/nlu
data: ./data/training_nlu.json

Example 1:

Garbage not picked from past 10 days,need immediate attention for clearance.

here i can pick out Garbage not picked is the issue. i can train my NLU to extract this named entity with ner_crf with below training

{
        "text": "Garbage not picked from past 10 days,need immediate attention for clearance",
        "intent": "inform_grevience",
        "entities": [
          {
            "start": 20,
            "end": 38,
            "value": "Garbage not picked",
            "entity": "issue"
          }
        ]
      }

Example 2:

A Garbage bin near 10 main is not picked from past 10 days , immediate action required

different citizen is reporting same problem but different sentence.

can i extract Garbage not picked from Example 2 as well using ner_crf ?

issue

thanks

Yes just label them both as two seperate entities, and then you can combine them in your custom action

Alternatively you can have a separate intent to handle this

Thanks, Akela, I have taken up both the solutions.

  1. I have to label them as separate entities and set entity value in custom actions
  2. when there are many possibilities I have to separate intents and set the entity value in custom action.