如何检查wordnet是否已经安装? [英] How to check if wordnet is already installed?

查看:57
本文介绍了如何检查wordnet是否已经安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们可以像这样检查资源:

I know that we can check for resources like this:

try:
  nltk.data.find('tokenizers/punkt')
except LookupError:
  nltk.download('punkt')

但我找不到为 wordnet 执行此操作的方法:

But I can't find the way to do this for wordnet:

try:
  nltk.data.find('wordnet') # ????/wordnet
except LookupError:
  nltk.download('wordnet')

我如何进行此检查?

推荐答案

您可以:

nltk.find('corpora/wordnet')

这篇关于如何检查wordnet是否已经安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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