I am looking for a way given an English text count verb phrases in it in past, present and future tenses. For now I am using NLTK, do a POS (Part-Of-Speech) tagging, and then count say 'VBD' to get past tenses. This is not accurate enough though, so I guess I need to go further and use chunking, then analyze VP-chunks for specific tense patterns. Is there anything existing that does that? Any further reading that might be helpful? The NLTK book is focused mostly on NP-chunks, and I can find quite few info on VP-chunks.
You can then use the POS tag on this verb to find its tense, and use that. You think? For "My dog has eaten my homework" you'll get the main verb (VBZ has) i.e. "present tense (with 3rd person inflection)". But perfect tense is in the past.
The basic way to form the past tense in English is to take the present tense of the word and add the suffix -ed. For example, to turn the verb "walk" into the past tense, add -ed to form "walked." .
Thee exact answer depends on which chunker you intend to use, but list comprehensions will take you a long way. This gets you the number of verb phrases using a non-existent chunker.
len([phrase for phrase in nltk.Chunker(sentence) if phrase[1] == 'VP'])
You can take a more fine-grained approach to detect numbers of tenses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With