How to define entity synonyms


(Manoj) #1

Hello, Can someone help me in How to define entity_synonyms in markdown format. I am able to define synonyms in nlu.md file and train them. But when I try to test it by giving examples. It is not extracting them as entities. Here is my nlu.md file.

nlu.md (1.3 KB)


(Romain Huber) #2

Do you have examples of sentences with entity in your training data ?

For example :

{
  "text": "show me chinese restaurants",
  "intent": "restaurant_search",
  "entities": [
    {
      "start": 8,
      "end": 15,
      "value": "chinese",
      "entity": "cuisine"
    }
  ]
}

You can use : RASA NLU Trainer to define do it easily


(Manoj) #3

Hello @huberrom. Thanks for responding. I want to know how to define entity synonyms and how to train them. please find my examples or sentences in nlu.md file in the issue I created.

Thank younlu.md (1.4 KB)


(Romain Huber) #4

I don’t know how to use the .md format since i’m using the json format for my bot, but your file looks ok to me. Do you have the components ner_synonyms (Component Configuration) and ner_crf (Component Configuration) in your pipeline ?


(Manoj) #5

Yes. I am using tensorflow_embedding pipeline. Here is my configuration file. Can I see your examples with entities and synonyms which are in json format.

nlu_config.yml (43 Bytes)


(Romain Huber) #6

testData (1).json (3.9 KB)

I can’t give you my examples, but it looks like this for an example with restaurant


(Manoj) #7

Thank you @huberrom. I will have a look at it and let you know if they works.


(Manoj) #8

Hello, Can you help me in command to train the model, if the data is in .json format. I have been using this command python -m rasa_nlu.train -c nlu_config.yml --data nlu.md -o models --fixed_model_name nlu --project current --verbose if the data is in markdown file. but this command is not correct for json file format. can you tell me command to train the data.


(Romain Huber) #9

It should be the same but nlu.json instead of nlu.md (if your file is name nlu of course)


(Manoj) #10

okay


(Manoj) #11

I am facing this error sir. I attached screenshot of it.


(Romain Huber) #12

I think it’s because of the ‘,’ after “bharath”, try without it. My bad


(Manoj) #13

Hey @huberrom. I trained the model and tried to run the model with some examples. But it is not extracting the entities which are named with synonyms. It only extracts entities when I give direct entity name in the sentence. Will this work for you everytime? Is my configuration file fine?


(Romain Huber) #14

I didn’t try with this example, but it should work and your configuration file is fine. I don’t think I can help you more, someone else need to take a look at that.

Maybe you need more example with entity


(Manoj) #15

No problem @huberrom. Thanks for your help till this point.