Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complex算法并没有实现最多分词 #17

Open
wangsheng23 opened this issue Aug 10, 2015 · 4 comments
Open

complex算法并没有实现最多分词 #17

wangsheng23 opened this issue Aug 10, 2015 · 4 comments

Comments

@wangsheng23
Copy link

你好,我使用的是mmseg4j-core-1.9.1,在介绍中,我看到了“1.6版在complex基础上实现了最多分词(max-word)。“很好听” -> "很好|好听"; “中华人民共和国” -> "中华|华人|共和|国"; “中国人民银行” -> "中国|人民|银行"。”
我使用了自定义的中文词库,总共有60多万个词条,但是我在Solr Admin中测试发现complex并没有实现最多分词。
比如我输入:“中华人民共和国",则分词的结果为:”中华人民共和国“,我输入”很好听的一首歌曲“,则分词的结果为:”很好听“,”一首“,”歌曲“。我想请问下是不是我需要配置什么filter之类吗,下面是我的配置:





@bravecharge
Copy link

因为 "的" 是个停顿字,stopword的作用就在于此

@wangsheng23
Copy link
Author

谢谢你,但不是的字的问题,因为我配置了停止词的,类似filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt",比如我输入”很好听一首歌曲“,也会分词为”很好听“而不是”很好“和”好听”,但我这个地方使用的是mode="complex",是不是我需要使用mode="max-word",如果是用mode="max-word"是可以解决这个问题,但是新问题又来了,比如我的输入内容为“林书豪赢了”,我期望分词中“林书豪”是一个整体(注:我测试确定林书豪已经被加入到我的词库中了”),但是max-word的分词结果是:“林”,”书“,”豪“,“赢了”,这样当我输入“林子里的小鸟时”,因为有“林”这个字,也会把“林书豪赢了”给搜索出来,这个结果显然不对。所以要是能够在complex的基础上真正的去做maxword肯定才是最完美的。

@bravecharge
Copy link

恩 用max-word complex是分出尽可能长的词

@wangsheng23
Copy link
Author

不好意思,你上面说的意思是用max-word还是ma-word complex? 我用max-word的时候,即便词库中有林书豪,分词的时候结果就是“林”,“书”,“豪”,这样的结果很显然就会导致我即便输入“林平治”,也会输出林书豪,因为有“林”这个字,这个怎么样去解决?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants