Synonyms for what?

187 views Asked by At

I implemented regexp.json file as follows, but I'm not sure if synonyms are for intents or for entities.
What are synonyms for? Could you please show me some examples of synonyms in this case?

{
  "intents" : [
    {
      "name" : ["greetings"],
      "grammar" : [
        "[How|What] is the [current|] weather in {location}"
      ]
    }
  ],

  "entities" : {
    "name":"location"
  },

  "synonyms" : [
   [""]
  ]
}
2

There are 2 answers

1
Troy On BEST ANSWER

Does this doc help? https://watson-personal-assistant.github.io/developer/further-topics/regexp_nlu/

If it doesn't, let us know that too.

synonyms are just so you don't have to provide every example grammar for every word of similar meaning.

1
t smile On

I updated the regexp.json as follows. It works well.

{
  "intents" : [
    {
      "name" : ["weather"],
      "grammar" : [
       "$ [What is|How is] the weather in {location}"
      ]
    }
  ],

  "entities" : {
    "location":["tokyo","osaka","kyoto"]
  },

  "synonyms" : [
   ["What is","What's","What","what"],
   ["How is","How's","How","how"],
   ["tokyo","Tokyo"],
   ["osaka","Osaka"],
   ["kyoto","Kyoto"]
  ]
}