Python调用自然语言处理包HanLP

Python调用自然语言处理包HanLP3.png一句话安装pyhanlp,全自动下载安装配置,还支持升级。

pip install pyhanlp
调用方法参考项目主页:https://github.com/hankcs/pyhanlp

Windows用户如果遇到:

building '_jpype' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
可以按提示安装Visual C++,也可以安装轻量级的Miniconda(推荐,超方便):

image

然后通过conda安装jpype1和pyhanlp:

conda install -c conda-forge jpype1
pip install pyhanlp

原文链接

猜你喜欢

转载自blog.csdn.net/weixin_40581617/article/details/83991657