带有WordNet 2.1的Python 3和NLTK-可能吗? [英] Python 3 and NLTK with WordNet 2.1 - is that possible?

查看:74
本文介绍了带有WordNet 2.1的Python 3和NLTK-可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WordNet 3.0中使用Python 3和NLTK 3.0.0.

I use Python 3 and NLTK 3.0.0 with WordNet 3.0.

我想使用此数据(semeval2007)使用WordNet 2.1.

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

是否可以将WordNet 2.1与Python 3一起使用?

Is that possible to use WordNet 2.1 with Python 3?

是否可以用WordNet 2.1替换WordNet 3.0?我该怎么办?

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

推荐答案

您可以使用WordNetCorpusReader加载特定版本的Wordnet.

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()

这篇关于带有WordNet 2.1的Python 3和NLTK-可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆