mirror of
https://github.com/mii443/akaza.git
synced 2025-08-22 14:55:31 +00:00
@ -130,13 +130,10 @@ impl<U: SystemUnigramLM, B: SystemBigramLM> LatticeGraph<U, B> {
|
|||||||
return if let Some((_, system_unigram_cost)) = node.word_id_and_score {
|
return if let Some((_, system_unigram_cost)) = node.word_id_and_score {
|
||||||
trace!("HIT!: {}, {}", node.key(), system_unigram_cost);
|
trace!("HIT!: {}, {}", node.key(), system_unigram_cost);
|
||||||
system_unigram_cost
|
system_unigram_cost
|
||||||
} else if node.surface == node.yomi {
|
} else if node.surface.len() < node.yomi.len() {
|
||||||
// 「ひらがな」で、変換しないエントリーを優先する。
|
// 労働者災害補償保険法 のように、システム辞書には wikipedia から採録されているが,
|
||||||
// 漢字で表現したい場合は、それを自分で変換して選択すればよろしい。
|
// 言語モデルには採録されていない場合,漢字候補を先頭に持ってくる。
|
||||||
// このようにしないと、例えば新語辞書に変なものが入ってきたときに
|
// つまり、変換後のほうが短くなるもののほうをコストを安くしておく。
|
||||||
// 優先されすぎてしまう。
|
|
||||||
//
|
|
||||||
// 新語には、短いものもあり、誤爆しがち。
|
|
||||||
self.system_unigram_lm.get_cost(1)
|
self.system_unigram_lm.get_cost(1)
|
||||||
} else {
|
} else {
|
||||||
self.system_unigram_lm.get_cost(0)
|
self.system_unigram_lm.get_cost(0)
|
||||||
|
Reference in New Issue
Block a user