elasticsearch-analysis-hao icon indicating copy to clipboard operation
elasticsearch-analysis-hao copied to clipboard

比 IK 更快怎么实现的?

Open qbit-git opened this issue 2 years ago • 2 comments

Readme 中有介绍 hao 分词器比 IK 更快,请问是怎样实现的呢?快多少? 我这边使用 IK 分词器扩展千万级词典时,索引建立效率大幅降低,请问 hao 分词器对这种情况有帮助吗?

qbit-git avatar Oct 20 '21 23:10 qbit-git

参考HanLP的Aho Corasick自动机结合DoubleArrayTrie的方式,所以在匹配上比IK快,但是在词库初始化和热更新的时候比较慢,看词库大小,目前的词库大小3s以内,完全可以接受。 文章:http://www.hankcs.com/program/algorithm/aho-corasick-double-array-trie.html 源码:https://github.com/hankcs/AhoCorasickDoubleArrayTrie

tenlee2012 avatar Nov 03 '21 03:11 tenlee2012

有测试过千万级的自定义词典吗?像下面这种。 ext_author.zip.001 ext_author.zip.002 ext_author.zip.003 github 限制单文件大小 25M,对词典做了分卷压缩。

qbit-git avatar Dec 02 '21 01:12 qbit-git