Git Product home page Git Product logo

elasticsearch-analysis-hanlp's Introduction

elasticsearch-analysis-hanlp

安装步骤:

1、下载插件并解压到es的plugins目录下

修改analysis-hanlp目录下的hanlp.properties文件,修改root的属性,值为analysis-hanlp下的data 目录的地址

修改analysis-hanlp目录下的plugin-descriptor.properties文件,
修改elasticsearch的版本为你当前的版本elasticsearch.version=你的es版本号(like:5.5.1)

2、修改es config目录下的jvm.options文件,最后一行添加

-Djava.security.policy=../plugins/analysis-hanlp/plugin-security.policy

重启es

GET /_analyze?analyzer=hanlp-index&pretty=true 

{ 

"text":"张柏芝士蛋糕店" 

}

测试是否安装成功

analyzer有hanlp-index(索引模式)和hanlp-smart(智能模式)

hanlp-index:尽可能的切分多的结果

hanlp-smart:切分少的词

自定义词典:

修改plugins/analysis-hanlp/data/dictionary/custom下的 我的词典.txt文件

格式遵从[单词] [词性A] [A的频次]

修改完后删除同目录下的CustomDictionary.txt.bin文件

重启es服务

首次启动hanlp会生成相应的文件,首次启动可能会慢一点

elasticsearch-analysis-hanlp's People

Contributors

kepmov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.