I'm trying to learn natural language processing (of English) using NLTK and Python. Is there a way to get the infinitive form of the verb during or after POS-tagging.
For example:
IN preposition/subordinating conjunction. JJ adjective 'big' JJR adjective, comparative 'bigger' JJS adjective, superlative 'biggest'
Parts of Speech (POS) Tagging. Parts of speech tagging simply refers to assigning parts of speech to individual words in a sentence, which means that, unlike phrase matching, which is performed at the sentence or multi-word level, parts of speech tagging is performed at the token level.
Close, you'll need to add the 'to' at the beginning:
>>> from nltk.stem.wordnet import WordNetLemmatizer
>>> lemmatizer = WordNetLemmatizer()
>>> lemmatizer.lemmatize('is', 'v')
'be'
>>> lemmatizer.lemmatize('provided', 'v')
'provide'
>>> lemmatizer.lemmatize('using', 'v')
'use'
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