Giter Club home page Giter Club logo

elasticsearch-analysis-hanlp's Introduction

elasticsearch-analysis-hanlp

HanLP Analyzer for ElasticSearch

此分词器基于HanLP,提供了HanLP中大部分的分词方式。暂只支持Elasticsearch 5.x.x。(http://www.hankcs.com/nlp)

安装方式

  1. 编译

checkout ik version respective to your elasticsearch version

git checkout tags/{version}

mvn package

copy and unzip target/releases/elasticsearch-analysis-hanlp-{version}.zip to your-es-root/plugins/hanlp

  1. 安装数据包

下载数据包,具体路径请查看https://github.com/hankcs/HanLP/releases

在ES的config目录下,新建hanlp目录,将解压好的数据包放入该目录

在hanlp目录下新建config目录,将hanlp的配置文件hanlp.properties文件放入该目录

修改hanlp.properties文件,将root路径配置为数据包的路径

修改ES的bin/elasticsearch.in.sh文件

将下行:

ES_CLASSPATH="$ES_HOME/lib/elasticsearch-5.x.x.jar:$ES_HOME/lib/*"

修改为

ES_CLASSPATH="$ES_HOME/lib/elasticsearch-5.x.x.jar:$ES_HOME/lib/*:$ES_HOME/config/hanlp/config"

  1. 重启Elasticsearch

提供的分词器说明

hanlp: hanlp默认分词

hanlp_standard: 标准分词

hanlp_index: 索引分词

hanlp_index: NLP分词

hanlp_n_short: N-最短路分词

hanlp_dijkstra: 最短路分词

hanlp_crf: CRF分词

hanlp_speed: 极速词典分词(配置为支持自定义字典以及启用数词和数量词识别,若有不同需求,请自行修改代码重新编译打包)

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.