python 下nltk的安装和使用

1,安装python库

pip install nltk

2.安装nltk_data

nltk_data是必要的nltk数据包,参考

python

>>>import nltk

>>>nltk.download()

然后就可以按提示进行了。速度比较慢,可以手动下载

下载方法:到https://github.com/nltk/nltk_data下载gh-pages分支,里面的Packages就是我们要的资源。

将Packages文件夹改名为nltk_data,放在以下任一路径,需要设置NLTK_DATA环境 变量

 

3.结合使用 word2vec 词向量

需要安装 from gensim.models import word2vec

pip --default-timeout=1000 install -U pip

pip install gensim

You May Also Like

About the Author: daidai5771

发表评论

电子邮件地址不会被公开。 必填项已用*标注