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

查看:48
本文介绍了如何进行 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

也许你可以看看:

一旦你解析了句子,你就有了回答问题的意图和其他信息.

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天全站免登陆