How to proceed with NLP task for recognizing intent and slots

白昼怎懂夜的黑 提交于 2019-11-29 20:38:15

Since your input is in the natural language form, best way to start looking into it, first by parsing the sentence structure. and running the sentence through NER (Named Entity Recognizer).

Parsing the sentence lets you come up with rules such as, certain types of dependencies always give you the intent. Running the NER will let you identify places and dates. If it's not simple to come up with rules to classify the intent, you can as well use a classifier to do the same using feature vector formulated from the input sentence. In fact some of the parser out put can go into formulating the feature vector.

For both there exists software's from Stanford NLP Group

May be you can look into:

Once you parse the sentence, you have intent and other information require to answer the question.

Ex: I took your sentence "Will it be sunny this weekend in Chicago." and ran it through Online Stanford NER Tagger. Which gave me the following:

Will it be sunny this <DATE>weekend</DATE> in <LOCATION>Chicago</LOCATION>

Now you have identified date and location.

I hope this helps. I know the answer is quite generic, and may be helpful in just getting started.

I think this api is exactly what you are looking for. It's easy and awesome to use.

https://wit.ai/

Additionally, https://www.luis.ai/ is a good implementation of an NLP framework. They have an API as well as a nuget SDK. We've been using them for awhile now. They were cheaper than the other options we looked at. i.e. wit.ai.

So re your example -

ex: Will it be sunny this weekend in Chicago -> would map to a LUIS intent called WeatherQuery. date -> would map to a pre-built LUIS dateTime entity location -> chicago -> would map to a pre-built LUIS entity -> geography or address I think.

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