斯坦福大学NLP-VP vs NP [英] Stanford NLP - VP vs NP

查看:245
本文介绍了斯坦福大学NLP-VP vs NP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个例子,斯坦福大学自然语言处理为该句子输出一个奇怪的分析树:

I have one example where Stanford NLP outputs a weird parse tree for the sentence:

Clean my desk

(ROOT
  (NP
    (NP (JJ Clean))
    (NP (PRP$ my) (NN desk))))

如您所见,它将单词Clean标记为一个依赖于动词desk的形容词,整个短语都标记为Noun Phrase,而我期望将Clean标记为动词,并将相位表示为Verb Phrase.

As you can see, it tags the word Clean as an adjective dependent on the verb desk with the whole phrase being tagged as a Noun Phrase, while my expectation is for Clean to be tagged as a verb, and the phase as a Verb Phrase.

JJ-PRP $ -NN组合对我来说根本就没有英语意义.任何人都遇到过类似的事情吗?我知道斯坦福大学NLP的结果有时会根据分析工具运行的顺序(?)而有所不同.如何正确制作此标签?

The JJ-PRP$-NN combination simply doesn't make sense in English to me. Anyone ever run into something similar? I know that Stanford NLP results sometimes differ based on the sequence (?) of parsing tools run. How to make this tag properly?

推荐答案

碰巧,如果您将句子"Clean my desk"直接输入解析器(实际上是'tokenize','ssplit'和'parse'工具) ,它给出以下结果:

As it happens, if you feed the sentence "Clean my desk" directly to the parser (actually, the 'tokenize', 'ssplit' and 'parse' tools), it gives the following result:

(ROOT (NP (NP (NNP Clean)) (NP (PRP$ my) (NN desk))))

但是,现在"Clean"是专有名词-斯坦福非常聪明.因此,如果我们用小写的第一个单词输入句子-"clean my desk"-我们最终得到了我们想要的东西:

However, now "Clean" is a Proper Noun - very clever, Stanford. So, if we feed the sentence in with the first word in lowercase - "clean my desk" - we finally get what we are looking for:

(ROOT (S (VP (VB clean) (NP (PRP$ my) (NN desk)))))

请注意不要将完整的句子转换为小写.在测试过程中,我注意到"I"变成小写字母"i"的单词被标记为FW(外来单词),因此只将第一个单词转换为小写.

Be careful not to convert the full sentence into lowercase. While testing I've noticed the the word "I" turned into lowercase "i" is tagged as FW (Foreign Word), so only covert the first word to lowercase.

这篇关于斯坦福大学NLP-VP vs NP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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