当前位置:网站首页>Mac installation hanlp, and win installation and use
Mac installation hanlp, and win installation and use
2020-11-06 01:27:00 【Elementary school students in IT field】
hanlp brief introduction :
HanLP It consists of a series of models and algorithms Java tool kit , The goal is to popularize nature
The application of language processing in production environment .HanLP It has perfect functions 、 High performance 、 framework
Clear 、 The corpus is up to date 、 Customizable features .
function : Chinese word segmentation Part of speech tagging Named entity recognition dependency parsing Keywords extraction
The discovery of new words Phrase extraction Automatic summarization Text classification Pinyin is simple and complicated
hanlp Environmental installation (mac)
hanlp yes java Open source library written by , stay python Call in environment hanlp need java Environmental support and python call java Tools for
- install java
- install Jpype
JPype It's a way to python The code makes it easy to call Java Code tools , To overcome python in some fields ( Such as server-side programming ) The deficiency in .
pip install jpype1
import jpype
print(jpype.__version__)
0.7.0
Perform the following code test :
import jpype
print(jpype.__version__)
if __name__=="__main__":
# Get system's jvm route
jvm_path = jpype.getDefaultJVMPath()
print(jvm_path)
# Set up jvm route , Start up java virtual machine
jpype.startJVM(jvm_path,convertStrings=False)
# perform java Code
jpype.java.lang.System.out.println('hello world')
# close jvm virtual machine , When used JVM after , Can pass jpype.shutdownJVM() To close JVM, The function has no input parameters . When python When the program exits ,JVM It will automatically turn off .
jpype.shutdownJVM()
/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/jli/libjli.dylib
hello world
Next configure hanlp install
1、 download hanlp.jar package : https://github.com/hankcs/HanLP
2、 download data.zip:https://github.com/hankcs/HanLP/releases in http://hanlp.linrunsoft.com/release/data-for-1.7.0.zip After decompressing the data package .
3、 The configuration file Sample configuration file :hanlp.properties The function of the configuration file is to tell HanLP The location of the packet , Just change the first line :root=usr/home/HanLP/ such as data Directory is /Users/hankcs/Documents/data, that root=/Users/hankcs/Documents/
You can also download it from my baidu disk .
Configuration path reference :https://objc.com/article/17
window Use reference below :https://blog.csdn.net/HHTNAN/article/details/81908451
Reference link :
Reference to the official website link
https://github.com/hankcs/HanLP
http://hanlp.com
版权声明
本文为[Elementary school students in IT field]所创,转载请带上原文链接,感谢
边栏推荐
- 在大规模 Kubernetes 集群上实现高 SLO 的方法
- axios学习笔记(二):轻松弄懂XHR的使用及如何封装简易axios
- Face to face Manual Chapter 16: explanation and implementation of fair lock of code peasant association lock and reentrantlock
- 如何玩转sortablejs-vuedraggable实现表单嵌套拖拽功能
- Do not understand UML class diagram? Take a look at this edition of rural love class diagram, a learn!
- 助力金融科技创新发展,ATFX走在行业最前列
- Summary of common algorithms of binary tree
- How to become a data scientist? - kdnuggets
- 一篇文章带你了解CSS3圆角知识
- Network security engineer Demo: the original * * is to get your computer administrator rights! 【***】
猜你喜欢
阿里云Q2营收破纪录背后,云的打开方式正在重塑
vue任意关系组件通信与跨组件监听状态 vue-communication
PN8162 20W PD快充芯片,PD快充充电器方案
I think it is necessary to write a general idempotent component
PHP应用对接Justswap专用开发包【JustSwap.PHP】
带你学习ES5中新增的方法
How do the general bottom buried points do?
It's so embarrassing, fans broke ten thousand, used for a year!
Tool class under JUC package, its name is locksupport! Did you make it?
做外包真的很难,身为外包的我也无奈叹息。
随机推荐
使用 Iceberg on Kubernetes 打造新一代云原生数据湖
Working principle of gradient descent algorithm in machine learning
6.3 handlerexceptionresolver exception handling (in-depth analysis of SSM and project practice)
Using consult to realize service discovery: instance ID customization
Skywalking series blog 1 - install stand-alone skywalking
axios学习笔记(二):轻松弄懂XHR的使用及如何封装简易axios
比特币一度突破14000美元,即将面临美国大选考验
git rebase的時候捅婁子了,怎麼辦?線上等……
华为云“四个可靠”的方法论
Brief introduction of TF flags
Python + appium automatic operation wechat is enough
深度揭祕垃圾回收底層,這次讓你徹底弄懂她
Calculation script for time series data
Advanced Vue component pattern (3)
從小公司進入大廠,我都做對了哪些事?
5.5 controlleradvice notes - SSM in depth analysis and project practice
多机器人行情共享解决方案
Computer TCP / IP interview 10 even asked, how many can you withstand?
PHPSHE 短信插件说明
Group count - word length