from nltk.stem.wordnet import WordNetLemmatizer l = WordNetLemmatizer() l.lemmatize('cars') # car l.lemmatize('women') # woman l.lemmatize('fantasized','v') # fantasizeSo, a word will be checked with wordnet to see its basic form according to part of speech.
Pages
Profile
|
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time.
Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more... |
Tuesday, December 28, 2010
How to Lemmatization with Wordnet in NLTK
We can convert a word back to its basic form by using wordnet lemmatizer. Moreover, we can specific part of speech to check its form: n->noun, v->verb, a->adjective, r->adverb (if not specify, it will be noun).
Labels:
NLP,
NLTK,
Programming,
Python
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment