Currently, my project involves with natural language processing and also wordnet for seeing the relationship between word meanings. In python, wordnet can be used with NLTK. NLTK has a wordnet of Princeton University.The main features that are supported in NLTK as following: synset, lemma, hypernym, hyponym, antonym and path similarity.
Basic use examples:
import nltk
from nltk import wordnet as wn
#looking word's synsets
wn.synsets('beautiful')
#synsets
car = wn.synset('car.n.01')
car.lemmas
car.hypernyms()
car.hyponyms()
#antonyms
car.lemmas[0].antonyms()
See more details at:
http://nltk.googlecode.com/svn/trunk/doc/howto/wordnet.html
http://wordnet.princeton.edu/
No comments:
Post a Comment