diff options
author | Taku Kudo <taku@google.com> | 2020-04-24 20:30:13 +0300 |
---|---|---|
committer | Taku Kudo <taku@google.com> | 2020-04-24 20:30:13 +0300 |
commit | b8101c5017cffad26d5c2352a73c9c731aa506a3 (patch) | |
tree | 05555e8342c291e3096c2bb48fd2c907b61edb28 /src | |
parent | e8a84a16d13e8bf92892a1cd92e4de3b0d0321fd (diff) |
Prefer longest user_defined_symbol if ambigous
Diffstat (limited to 'src')
-rw-r--r-- | src/unigram_model.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unigram_model.cc b/src/unigram_model.cc index 083097d..4af85ef 100644 --- a/src/unigram_model.cc +++ b/src/unigram_model.cc @@ -403,7 +403,7 @@ void Model::PopulateNodes(Lattice *lattice) const { Lattice::Node *node = lattice->Insert(begin_pos, length); node->id = id; // the value of Trie stores vocab_id. // User defined symbol receives extra bonus to always be selected. - node->score = IsUserDefinedInlined(id) ? (length * max_score_ + 1.0) + node->score = IsUserDefinedInlined(id) ? (length * max_score_ - 0.1) : GetScoreInlined(id); if (!has_single_node && node->length == 1) { has_single_node = true; |