有没有Phrase head finder? [英] Is there any Phrase head finder?

查看:134
本文介绍了有没有Phrase head finder?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些我要解析的句子。这就是我拥有的和我需要的东西:我有这样的句子:

I have some sentences that I want to parse. Here is what I have and what I need: I have sentences like these:


我在医院。

I was in the hospital.

我要从家到加拿大。

我想要的是要知道在医院,从家里和到加拿大这些短语的负责人。

What I want is to know the head of "in the hospital", "from home", and "to Canada" phrases.

我正在使用Berkley解析器,但它给我的是所有句子的解析结果,如果我想手动提取短语的头部,我应该开发另一个解析器!我要解析的文件是一个非常大的文件,所以如果我自己开发一个解析器,它可能会有很多错误。是否有任何解析器可以提供我正在寻找的结果?

I am using Berkley parser, but what it gives me is the parsing result of all the sentence, and if I want to extract the head of phrases manually, I should develop another parser! The file that I want to parse is a very big file, so if I develop a parser myself, it may have many errors. Is there any parser that can give me the result I am looking for?

顺便说一句,分别解析短语可能会导致与句子解析相比不同的解析,我坚持解析句子,然后提取短语头。

By the way, as parsing the phrases separately, may result in a different parsing compared with sentence parsing, I insist on parsing the sentences and then extract the phrase heads.

推荐答案

S tanford Parser OpenNLP 解析器将为您提供词性和依赖关系信息,你可以用它来确定短语的头部

The Stanford Parser and the OpenNLP parsers will give you Part-of-Speech and dependency information, which you can use to determine the head of phrases

例如,使用斯坦福解析器,你会得到:

For example, using the Stanford parser, you would get:

(S
  (NP (PRP I))
  (VP (VBD was)
      (PP (IN in)
          (NP (DT the)
              (NN hospital)))))

其中告诉你句子(S)由名词短语(NP)和动词短语(VP)组成;动词短语是动词(V *)+介词短语(PP),它是中的介词和名词短语;第二个名词短语是一个限定词(DT)和一个名词(NN)。

Which tells you that the sentence (S) consists of a noun-phrase (NP) and a verb-phrase (VP); the verb-phrase is a verb (V*) + prepositional phrase (PP), which is the preposition in and a noun-phrase; the second noun-phrase is a determiner (DT) and a noun (NN).

如果我理解了这个问题,你正在寻找名词短语的头部(可能还有动词短语)。您可以从此信息中识别头部,但解析器也会为您提供以下依赖项信息:

If I understand the question properly, you are looking for the heads of noun-phrases (and possibly the verb-phrases). You can identify the head from this information already, but the parser gives you the following dependency information as well:

nsubj(was, I)
prep_in(was, hospital)
det(hospital, the)

这告诉你 I 这些词是名义主题 nsubj 的关系(是动词 )的主题;单词 医院处于in介词( prep-in )关系中;单词hospital和the属于限定词( det )。使用先前的解析和依赖性信息,您可以判断第一个名词短语的头部是I(平凡),第二个名词短语的头部是医院(因为它是顶部)名词短语中关系的元素)

This tells you that the words was and I are in an nominal-subject nsubj relationship (I is the subject of the verb was); the words was and hospital are in an "in" preposition (prep-in) relationship; the words "hospital" and "the" are in a determiner (det) relationship. Using the previous parsing and the dependency information, you can tell that the head of the first noun-phrase is "I" (trivial), and the head of the second noun-phrase is "hospital" (as that is the "top" element of the relations within the noun-phrase)

这篇关于有没有Phrase head finder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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