not able to extract entities from user phrases when uploading intent using api

Deadly 提交于 2020-01-06 05:26:08

问题


I am trying to build an intent using DialogFlow api.

Intent name: makePizza  
Phases: ['I want to order pizza', 'I want to order small pizza']  
Response: ['Your pizza is on its way']  

After uploading the intent, it looks like this:

But if I make intent from the console and add phrase I want to order small pizza it automatically detects that keyword small is size parameter:

size entity is already added in the agent.

I understand that this can be achieved using below code:

training_phrases_parts = [
    {
        'type': 'EXAMPLE',
        'parts': [
            {'text': "i want to order "},
            {'text': 'small', 'entity_type': '@size', 'alias': 'size'},
            {'text': ' pizza'},
        ]
}]

But that is not doable for so many intents because there will be so many intents and their user phrases (which might or might not contains parameters). Please give suggestion to make this generic, i was not able to make it generic.

Is there any way to achieve this after the intents are uploaded to DialogFlow? Like detecting the entities from the user phrases? Or any other suggestion please!

Note 1: I tried to upload related parameters as well along with the intent, but that did not did the trick as well.

来源:https://stackoverflow.com/questions/52772894/not-able-to-extract-entities-from-user-phrases-when-uploading-intent-using-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!