2010-04-15 18 views

Trả lời

12

NLTK và Wordnet có thể giúp: ví dụ, mỗi this article,

from nltk.corpus import wordnet 

dog = wordnet.synset('dog.n.01') 
print(dog.lemma_names()) 

in:

['dog', 'domestic_dog', 'Canis_familiaris'] 
3

Bạn cũng có thể sử dụng PyDictionary

Ví dụ,

from PyDictionary import PyDictionary 
dictionary=PyDictionary() 
print (dictionary.synonym("good")) 

Đầu ra là

[u'great', u'satisfying', u'exceptional', u'positive', u'acceptable'] 

này là thực sự lấy lời từ www.thesaurus.com và là một chút chậm. Đa luồng có thể giúp tăng tốc nó.

Các vấn đề liên quan