No entity values by Rasa NLU - "entities": []

I am trying to pass a sentence to the rasa NLU and get the entities for that sentence. Really basic, but somehow the NLU is not returning any entities though it identifies it during training.

config.yml

language: en

pipeline:
  - name: "SpacyNLP"
  - name: "SpacyTokenizer"
  - name: "SpacyFeaturizer"
  - name: "RegexFeaturizer"
  - name: "CRFEntityExtractor"
  - name: "EntitySynonymMapper"
  - name: "SklearnIntentClassifier"

policies:
  - name: MemoizationPolicy
  - name: KerasPolicy

nlu.md

##intent:ask_name
- What's your name?
- I'd like to know your name.
- Name of yours please.
- Your name please?
- Your name?
- Tell me your name.
- What are you called?
- Who are you?


##intent:country
- UK
- USA
- India
- Germany
- France
- Spain
- Brazil
- Argentina


##intent:organization
- I work at Google
- Facebook
- Microsoft
- LinkedIn
- I am working for Uber
- Apple is the company I want to work for


##intent:tell_name
- My name is Shayan Sadar
- My name is Brian
- My name is James
- My name is Ankur Nair
- I'm Krishna
- I'm Rowland
- My name is David Beckham
- Keanu Reeves
- Tom Hanks
- Will Smith


##intent:inform_sex
- male
- female
- man
- boy
- woman
- girl
- I am a guy
- I am a man
- I am a male
- I am a girl
- I am a woman
- I am a female


##intent:inform_age
- 55
- 33
- 22
- 14
- 8
- I am 33 years old
- I am 23 years old
- I am 14 years old


##intent:greetings
- How are you today?
- How are you doing?
- How’re you?
- How ya doin’?
- Hey!
- What’s up?
- How’s your day?
- How’s your day going?
- How have you been?
- How do you do?
- Are you okay?
- You alright boss?
- Alright mate?


##intent:bye
- okay see you later 					
- hope to see you later 					
- bye for now 					
- till next time 					
- bye 					
- goodbye 					
- see you 					
- see you soon 					
- bye-bye 					
- good bye 					
- bye bye see you 					
- bye bye take care 					
- goodbye for now 					
- talk to you later 					
- goodbye see you later 					
- alright bye 					
- thanks bye bye 					
- okay bye 					
- ok bye 					
- nice talking to you 					
- it is nice talking to you 					
- it's been so nice to talk to you 					
- it's been a pleasure talking to you


##intent:reminder
- set a reminder
- remind me for the appointment
- Remind to meet the doctor
- Set up a reminder on the day of the appointment




## intent:4434fac086674178ab5dcea95ec5a0ff_a1b4f877-22a5-4155-b488-71c141907f07_0
- I am feeling [well](positive)
- I am feeling [good](positive)
- I am [well](positive)
- I am [good](positive)
- I'm [well](positive)
- I'm [good](positive)
- I'm [fine](positive)
- I'm [ok](positive)


## intent:4434fac086674178ab5dcea95ec5a0ff_a1b4f877-22a5-4155-b488-71c141907f07_1
- I am feeling bad
- I am feeling poor
- I am not feeling well
- I am not feeling good
- I'm not feeling well
- I feel bad
- I'm not ok


##synonym:well
- great

Training command line message:

Training NLU model...
2019-10-03 20:17:36 INFO     rasa.nlu.utils.spacy_utils  - Trying to load spacy model with name 'en'
2019-10-03 20:17:50 INFO     rasa.nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.
2019-10-03 20:17:50 INFO     rasa.nlu.training_data.training_data  - Training data stats: 
        - intent examples: 107 (11 distinct intents)
        - Found intents: 'organization', 'country', 'inform_sex', 'bye', '4434fac086674178ab5dcea95ec5a0ff_a1b4f877-22a5-4155-b488-71c141907f07_0', '4434fac086674178ab5dcea95ec5a0ff_a1b4f877-22a5-4155-b488-71c141907f07_1', 'tell_name', 'reminder', 'inform_age', 'ask_name', 'greetings'
        - Number of response examples: 0 (0 distinct response)
        - entity examples: 8 (1 distinct entities)
        - found entities: 'positive'

Output:

{"entities":[],"intent":{"confidence":0.49064129527452727,"name":"4434fac086674178ab5dcea95ec5a0ff_a1b4f877-22a5-4155-b488-71c141907f07_0"},"intent_ranking":[{"confidence":0.49064129527452727,"name":"4434fac086674178ab5dcea95ec5a0ff_a1b4f877-22a5-4155-b488-71c141907f07_0"},{"confidence":0.12801796094876924,"name":"4434fac086674178ab5dcea95ec5a0ff_a1b4f877-22a5-4155-b488-71c141907f07_1"},{"confidence":0.07269746722180075,"name":"inform_sex"},{"confidence":0.06478303033158993,"name":"organization"},{"confidence":0.05112922669836066,"name":"bye"},{"confidence":0.0498409739980387,"name":"tell_name"},{"confidence":0.03790709250505035,"name":"greetings"},{"confidence":0.03647715414851329,"name":"inform_age"},{"confidence":0.0362652232348006,"name":"ask_name"},{"confidence":0.019333460332336225,"name":"reminder"}],"text":"I am feeling well"}

Why is “entities”: [] ?

Sentence passed to the RASA interpreter: Eg1: I am feeling well Eg2: I am feeling great - I want ‘great’ to be classified as entity as well because it is defined as a synonym.

Configuration: Rasa 1.3.6 Python 3.6.8

Use the interactive learning to see the flow of the conversation. You can also make corrections to get better training examples.

Add ‘great’ to one of the intent examples or to a lookup table for positive.

But do you really need the entities? It seems that the only thing you need in this case is the intent.

I did try it. I think something is wrong with the pipeline and that’s where things need to be fixed. Can’t figure out though.

This is just a basic test case, need this to work to try it out on a larger project. I need to return both the intent classification and the entities if any, present in the input text.

hi @shayan09 - you can try running rasa shell nlu to try different test sentences and see what NLU predicts. Most likely you will need some more training data.

Thanks @amn41. That was sort of the case, turns out the ‘well’ entity is in two intents and one was marked while the other wasn’t. Was able to resolve it.