如何继续进行NLP任务以识别意图和位置 [英] How to proceed with NLP task for recognizing intent and slots

查看:144
本文介绍了如何继续进行NLP任务以识别意图和位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个程序来询问有关天气的问题.我应该开始研究什么算法和技术.

I wanted to write a program for asking questions about weather. What are the algorithms and techniques I should start looking at.

例如:这个周末在芝加哥会晴天吗? 我想知道意图 =天气查询,日期 =本周末,位置 =芝加哥.

ex: Will it be sunny this weekend in Chicago. I wanted to know the intent = weather query, date = this weekend, location = chicago.

用户可以以多种形式表达相同的查询.

User can express the same query in many forms.

我想解决一些约束形式,并寻找有关入门的想法.解决方案必须足够好.

I would like to solve some constrained form and looking for ideas on how to get started. The solution needs to be just good enough.

推荐答案

由于您的输入采用自然语言形式,因此最好的方法是首先通过分析句子结构来开始对其进行研究.并通过NER(命名实体识别器)运行该句子.

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).

通过分析句子,您可以得出一些规则,例如,某些类型的依存关系始终可以为您提供意图.运行NER将使您能够确定地点和日期.如果想出一些规则来对意图进行分类不是很简单,那么您也可以使用分类器来完成从输入语句中提取的特征向量.实际上,某些解析器可以用于制定特征向量.

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.

对于这两者,都有 Stanford NLP Group

也许您可以调查一下:

  • Stanford parser
  • Stanford NER Tagger

解析句子后,您就有意图并需要其他信息来回答问题.

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

例如:我听了你的话:这个周末芝加哥会晴天吗?"并通过在线斯坦福NER Tagger 运行它.这给了我以下内容:

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.

这篇关于如何继续进行NLP任务以识别意图和位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆