1

我按如下方式实现了 regexp.json 文件,但我不确定同义词是用于意图还是用于实体。
什么是同义词?在这种情况下,你能告诉我一些同义词的例子吗?

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

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

  "synonyms" : [
   [""]
  ]
}
4

2 回答 2

1

我更新了 regexp.json 如下。它运作良好。

{
  "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"]
  ]
}
于 2018-09-29T06:44:35.603 回答
0

这个文档有帮助吗? https://watson-personal-assistant.github.io/developer/further-topics/regexp_nlu/

如果没有,也请告诉我们。

同义词只是为了让您不必为每个具有相似含义的单词提供每个示例语法。

于 2018-09-28T02:30:31.570 回答