使用斯坦福大学nlp查找句子的时态 [英] Finding Tense of A sentence using stanford nlp

查看:331
本文介绍了使用斯坦福大学nlp查找句子的时态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Q1.我正在尝试使一个完整的句子变得紧张,只是不知道如何使用nlp. 任何帮助表示赞赏.

Q1.I am trying to get tense of a complete sentence,just don't know how to do it using nlp. Any help appreciated.

Q2.使用nlp可以从句子中提取所有信息吗?

Q2 .What all information can be extracted from a sentence using nlp?

我现在可以, 我得到:1.句子的声音 2.主体动词 3.POS标签.

Currently I can, I get : 1.Voice of sentence 2.subject object verb 3.POS tags.

可以提取更多信息,请告诉我.

Any more info can be extracted please let me know.

推荐答案

Penn树库分别将VBDVBN定义为动词的过去式和过去分词.在许多句子中,仅获取POS标签并检查是否存在这两个标签就足够了.但是,在其他情况下,动词可能具有多个时态,而整个句子都处于过去时态.对于这些情况,您需要使用选区分析. Stanford NLP还提供了一个解析器.您可以使用它来检测最外面的动词短语(标记为VP).如果动词的过去式/分词形式是该动词短语中所有其他动词的祖先,则句子的时态应标记为过去式.

The Penn treebank defines VBD and VBN as the past tense and the past participle of a verb, respectively. In many sentences, simply getting the POS tags and checking for the presence of these two tags will suffice. In others, however, there may be verbs in multiple tenses while the sentence as a whole is in the past tense. For these cases, you need to use constituency parsing. Stanford NLP also provides a parser. You can use this to detect the outermost verb phrase (tagged as VP). If a past tense/participle form of a verb is an ancestor of all other verbs in the verb phrase, the tense of your sentence should be marked as past tense.

由Dror给出的示例得出了这样的结果:

The example given by Dror yields this:

(ROOT
  (S
    (NP (PRP I))
    (VP (VBD did) (RB n't)
      (VP (VB want)
        (NP (DT the) (NN dog)
          (S
            (VP (TO to)
              (VP (VB eat)
                (NP (PRP$ my) (NN homework))))))))
    (. .)))

即使 eat 没有过去时,动词短语中最上面的动词也已正确标记为VBD(即过去时).

Even though eat is not past tense, the topmost verb in the verb phrase is correctly tagged VBD (i.e. past tense).

修改(一些其他信息):

复杂句子具有主要时态次要时态.对于诸如等我到达那儿之前,他已经离开"的句子,就没有完整时态"之类的东西.您只能区分主要和次要.

Complex sentences have what is called the primary tense and a secondary tense. For sentences like "By the time I will reach there, he'd have already left", there is no such thing as 'the complete tense'. You can only distinguish between the primary and the secondary.

如果您需要有关 perfect continuous 等的信息,则必须基于POS标签派生规则.例如.当前时态的辅助动词和过去时态的动词将表示现在完成时态(如果有明显的反例,请添加到答案中……我现在想不起来了.)

If you want information about perfect, continuous, etc., then you will have to derive rules based on the POS tags. E.g. an auxiliary verb in present tense followed by a verb in the past tense will express the present perfect tense (if there are obvious counterexamples, please add to the answer ... I can't think of any right now).

这篇关于使用斯坦福大学nlp查找句子的时态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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