我如何获取搜索的确切词,而不是 DialogFlow 中的同义词(以前,API.ai)

How do i fetch the exact word that is searched, instead of its synonym in DialogFlow (Formerly, API.ai)

我正在使用 dialogflow 让用户查询我产品的关键字并为他们提供这些特定关键字的值。

但问题是,当用户搜索那些已经在我的实体列表中定义的关键字的同义词时。

Its HTTP call, returns me the root word, and not the synonym due to which I am not able to find the dropped words.

如何检索所提取的确切单词?

请查看下面的屏幕截图以便更好地理解

Look at the KPIs, as it fetched "Death Rate"

Look at parameters that are fetched, under KPIs, it is fetched as "Mortality"

Screenshot of my entities, Mortality has a synonym "Death Rate"

我需要获取输入的确切关键字

我知道,我可以把每个词放在实体中,同义词分开,但是对于大量数据来说太模糊了。由于实体数量也有限制

要获取关键字,您只需使用返回的实体 ($entity_name)。要获取匹配的确切同义词,请使用 $entity_name.original。您在训练短语中看到的是已解析的值,但如果您检查 JSON(从右下角的诊断信息,您会看到 returns 的实体是已定义的实体。

以您为例,我的实体名为 Mortality,同义词之一是 'death rate'。您可以看到解析值与返回的实际实体名称之间的差异