使用 stanford nlp 查找 A 的时态 [英] Finding Tense of A sentence using stanford nlp

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

问题描述

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.

推荐答案

宾夕法尼亚州树库将 VBDVBN 定义为动词的过去时和过去分词,分别.在许多句子中,只需获取 POS 标签并检查这两个标签是否存在就足够了.然而,在其他情况下,可能有多个时态的动词,而整个句子都是过去时态.对于这些情况,您需要使用选区解析.斯坦福 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.

如果您想要关于完美连续等的信息,那么您必须根据 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).

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

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