1

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" : [
   [""]
  ]
}
t smile
  • 35
  • 4

2 Answers2

1

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"]
  ]
}
t smile
  • 35
  • 4
  • 1
    One thing to note is that the Watson Assistant Solutions routing core normalizes text that goes through it before sending it to the skill. As part of the normalization, it lower cases every thing and even strips out punctuation. We are working on a doc topic that goes further into this. The most description we have on it is buried in the JSON structure doc here: https://watson-personal-assistant.github.io/developer/reference/JSON_formats/#table-4---evaluate-request-parameters – Troy Oct 01 '18 at 13:11
0

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.

Troy
  • 188
  • 8
  • Hi Troy, thank you for your quick response. This doc helped me understand the relation among synonyms and intents and entities. – t smile Sep 29 '18 at 06:41