How to get entities depending on intents?

Hey Rasa-Community,

im working on a NLU-Model for several days now. I recognized that all those pipelines are quite different in terms of performance. The tensorflow-embedding-pipeline seems to be very good at recognizing intents. However tensorflow seems to be not able to get any entities… Spacy works pretty well but its not that precise as tensorflow is.

So i decided to watch out for a pipeline that uses Spacy and Tensorflow in combination. Im currently working with this pipeline:

language: en pipeline:

  • name: “nlp_spacy”
  • name: “tokenizer_spacy”
  • name: “intent_entity_featurizer_regex”
  • name: “tokenizer_whitespace”
  • name: “ner_crf”
  • name: “ner_synonyms”
  • name: “intent_featurizer_count_vectors”
  • name: “intent_classifier_tensorflow_embedding”

The pipeline nearly works fine. However i got a problem: The entities are not fixed to the intents.

Example:

#intent:TellsFavouriteColor

  • I like the color [green] (color)

#intent:TellsFavouriteBand

  • I often listen to [Green Day] (band)

This is just a simple representation of my problem. Of course i use much more examples of intents. Lets get to the problem: if a user inputs: “I listen to Green Day”, then it recognizes the correct intent “TellFavouriteBand”. BUT it often just tells me the entity “color” with value “green” then… Entities seems to be completly independent of the intents. Thats the complete opposite of what i actually wanted…

How can i set up the model, so the entity-recognition is dependent on the recognized intent? So i can only get a entity “band” back if it recognized intent “TellsFavouriteBand”.

Any ideas on that?

Thank you :slight_smile: Greetings, Marc

How to deal with exacty this problem is described over here.

We had this problem for some time and came up with the solution above. Please let me know if you need more details on how to get this done.

1 Like