HanLP icon indicating copy to clipboard operation
HanLP copied to clipboard

"齐云山高纯山茶油"分词bug

Open liuia opened this issue 11 years ago • 2 comments

偶然遇到这个广告词,目前的nlp分词结果是“齐云山高/ns, 纯/a, 山茶油/nf” 正确的应该是“齐云山 高纯 山茶油”

liuia avatar Jun 04 '15 16:06 liuia

hankcs闭关修练去了,估计暂时回答不了你问题。

字典CustomDictionary.txt 中添加 词项

齐云山 高纯

CoreNatureDictionary.ngram.txt 中添加相应2gram词频 未##地@高纯 1000

==================最短距输出结果================== 粗分词图:========按终点打印======== to: 1, from: 0, weight:04.60, word:始##始@齐 to: 2, from: 0, weight:03.41, word:始##始@未##地 to: 3, from: 1, weight:11.33, word:齐@云 to: 4, from: 1, weight:11.33, word:齐@云山 to: 5, from: 3, weight:11.15, word:云@山 to: 6, from: 3, weight:06.60, word:云@未##地 to: 7, from: 2, weight:01.57, word:未##地@高 to: 7, from: 4, weight:11.61, word:云山@高 to: 7, from: 5, weight:04.22, word:山@高 to: 8, from: 2, weight:00.11, word:未##地@高纯 to: 8, from: 4, weight:11.61, word:云山@高纯 to: 8, from: 5, weight:11.05, word:山@高纯 to: 9, from: 6, weight:01.10, word:未##地@纯 to: 9, from: 7, weight:07.35, word:高@纯 to: 10, from: 8, weight:11.25, word:高纯@山 to: 10, from: 9, weight:11.47, word:纯@山 to: 11, from: 8, weight:11.25, word:高纯@山茶 to: 11, from: 9, weight:11.47, word:纯@山茶 to: 12, from: 8, weight:11.25, word:高纯@山茶油 to: 12, from: 9, weight:11.47, word:纯@山茶油 to: 13, from: 10, weight:11.05, word:山@茶 to: 14, from: 10, weight:11.05, word:山@茶油 to: 15, from: 11, weight:11.61, word:山茶@油 to: 15, from: 13, weight:11.41, word:茶@油 to: 16, from: 12, weight:11.61, word:山茶油@末##末 to: 16, from: 14, weight:11.60, word:茶油@末##末 to: 16, from: 15, weight:04.90, word:油@末##末

粗分结果[齐云山/ns, 高纯/a, 山茶油/nf]

==粗分正确后,召回就没问题了== [齐云山/ns, 高纯/a, 山茶油/nf]

yuchaozhou avatar Jun 05 '15 09:06 yuchaozhou

你好,抱歉没有及时回复。 感谢@yuchaozhou帮忙。

另一种解决方案是删除data/dictionary/custom/现代汉语补充词库.txt里面的 山高 ns 3

得到

[齐云山/nr, 高纯/nr, 山茶油/nf]

虽然被当成人名了,不过从分词的角度来讲,也算凑合。

hankcs avatar Jun 08 '15 10:06 hankcs