如何找出如果一个句子是一个问题,(疑问)? [英] How to find out if a sentence is a question (interrogative)?

查看:217
本文介绍了如何找出如果一个句子是一个问题,(疑问)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个开源的Java库/算法发现,如果一个特定的一段文字,一个问题或不?
我的工作需要,如果用户的文字输入是一个问题,分析问题应答系统。
我想这个问题或许可以通过使用开源NLP库,但它明显比词性标注的简单零件更复杂的解决。因此,如果有人能代替告诉算法,它利用现有的开源NLP库,这将是一件好事。
也让我知道,如果你知道一个图书馆/工具包,利用数据挖掘技术来解决这个问题。虽然这将是很难得到足够的数据用于训练目的,我将能够使用堆栈交换数据进行训练。

Is there an open source Java library/algorithm for finding if a particular piece of text is a question or not?
I am working on a question answering system that needs to analyze if the text input by user is a question.
I think the problem can probably be solved by using opensource NLP libraries but its obviously more complicated than simple part of speech tagging. So if someone can instead tell the algorithm for it by using an existing opensource NLP library, that would be good too.
Also let me know if you know a library/toolkit that uses data mining to solve this problem. Although it will be difficult to get sufficient data for training purposes, I will be able to use stack exchange data for training.

推荐答案

在一个问题一个语法解析,正确的结构将在形式:

In a syntactic parse of a question, the correct structure will be in the form of:

(SBARQ (WH+ (W+) ...)
       (SQ ...*
           (V+) ...*)
       (?))

因此​​,使用句法解析器中任何可用的,与具有嵌入的SQ一个SBARQ节点树(任选)将是一个指标的输入是一个问题。该WH +节点(WHNP / WHADVP / WHADJP)包含了题干(谁/什么/何时/何地/为什么/如何)和SQ保持倒短语。

So, using anyone of the syntactic parsers available, a tree with an SBARQ node having an embedded SQ (optionally) will be an indicator the input is a question. The WH+ node (WHNP/WHADVP/WHADJP) contains the question stem (who/what/when/where/why/how) and the SQ holds the inverted phrase.

即:

(SBARQ 
  (WHNP 
    (WP What)) 
  (SQ 
    (VBZ is) 
    (NP 
      (DT the) 
      (NN question)))
  (. ?))

当然,有很多的preceeding条款将导致解析错误(就是可以被加工),这将真正写得不好的问题。例如,这篇文章的标题是如何找出如果一个句子是一个问题吗?将有一个SBARQ,但不是一个SQ

Of course, having a lot of preceeding clauses will cause errors in the parse (that can be worked around), as will really poorly-written questions. For example, the title of this post "How to find out if a sentence is a question?" will have an SBARQ, but not an SQ.

这篇关于如何找出如果一个句子是一个问题,(疑问)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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