Determining tense of a sentence Python

后端 未结 3 1849
孤街浪徒
孤街浪徒 2021-01-31 20:30

Following several other posts, [e.g. Detect English verb tenses using NLTK , Identifying verb tenses in python, Python NLTK figure out tense ] I wrote the following code to dete

3条回答
  •  醉梦人生
    2021-01-31 20:47

    You could use the Stanford Parser to get a dependency parse of the sentence. The root of the dependency parse will be the 'primary' verb that defines the sentence (I'm not too sure what the specific linguistic term is). You can then use the POS tag on this verb to find its tense, and use that.

提交回复
热议问题