当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- TRON智能钱包PHP开发包【零TRX归集】
- 基於MVC的RESTFul風格API實戰
- ES6学习笔记(二):教你玩转类的继承和类的对象
- Filecoin的经济模型与未来价值是如何支撑FIL币价格破千的
- 多机器人行情共享解决方案
- xmppmini 專案詳解:一步一步從原理跟我學實用 xmpp 技術開發 4.字串解碼祕笈與訊息包
- Synchronous configuration from git to consult with git 2consul
- 比特币一度突破14000美元,即将面临美国大选考验
- “颜值经济”的野望:华熙生物净利率六连降,收购案遭上交所问询
- Programmer introspection checklist
猜你喜欢
熬夜总结了报表自动化、数据可视化和挖掘的要点,和你想的不一样
Working principle of gradient descent algorithm in machine learning
一篇文章带你了解HTML表格及其主要属性介绍
[JMeter] two ways to realize interface Association: regular representation extractor and JSON extractor
Brief introduction of TF flags
Not long after graduation, he earned 20000 yuan from private work!
In order to save money, I learned PHP in one day!
What is the side effect free method? How to name it? - Mario
PHPSHE 短信插件说明
Mongodb (from 0 to 1), 11 days mongodb primary to intermediate advanced secret
随机推荐
前端都应懂的入门基础-github基础
JVM memory area and garbage collection
Existence judgment in structured data
加速「全民直播」洪流,如何攻克延时、卡顿、高并发难题?
Natural language processing - BM25 commonly used in search
Python + appium automatic operation wechat is enough
Python3 e-learning case 4: writing web proxy
Python download module to accelerate the implementation of recording
Programmer introspection checklist
[JMeter] two ways to realize interface Association: regular representation extractor and JSON extractor
Filecoin的经济模型与未来价值是如何支撑FIL币价格破千的
Installing the consult cluster
Wiremock: a powerful tool for API testing
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
带你学习ES5中新增的方法
Flink的DataSource三部曲之二:内置connector
5.5 controlleradvice notes - SSM in depth analysis and project practice
一篇文章带你了解CSS对齐方式
After reading this article, I understand a lot of webpack scaffolding
Grouping operation aligned with specified datum