1. 程式人生 > >Python呼叫自然語言處理包HanLP

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

原文連結