Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpaCy NLP- Detect the verb form

Tags:

python

nlp

spacy

As far as I know that we can get the v1 form of a verb using

word.lemma_

I wanted to know is their a way in which we can get the form of the verb like:

swims it should output v4

Is their way to do that using SpaCy or any other lib and if there is then please give a link to that command

like image 379
Ibrahim Avatar asked Oct 21 '25 13:10

Ibrahim


1 Answers

There are 6 verb forms available in spacy:

VB  --  verb, base form
VBD  --  verb, past tense
VBG  --  verb, gerund or present participle
VBN  --  verb, past participle
VBP  --  verb, non-3rd person singular present
VBZ  --  verb, 3rd person singular present

This is what you can get by calling word.tag_. However, I don't know how they relate to your v1 or v4. To find all tags just call:

for label in nlp.get_pipe("tagger").labels:
    print(label, " -- ", spacy.explain(label))
like image 135
krisograbek Avatar answered Oct 23 '25 04:10

krisograbek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!