Python 3 and NLTK with WordNet 2.1 - is that possible?

↘锁芯ラ 提交于 2019-12-08 02:41:30

问题


I use Python 3 and NLTK 3.0.0 with WordNet 3.0.

I would like to use this data (semeval2007) with WordNet 2.1.

Is that possible to use WordNet 2.1 with Python 3?

Is that possible to replace WordNet 3.0 with WordNet 2.1? How can i do that?


回答1:


You can use WordNetCorpusReader to load specific version of wordnet.

from nltk.corpus import WordNetCorpusReader

wn2 = WordNetCorpusReader("WordNet-2.0/dict", nltk.data.find("WordNet-2.0/dict"))

print wn2.get_version()


来源:https://stackoverflow.com/questions/29332454/python-3-and-nltk-with-wordnet-2-1-is-that-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!