Skip to content

Commit

Permalink
Merge pull request #9 from lilt/unk_hack
Browse files Browse the repository at this point in the history
UNK hack
  • Loading branch information
pks authored Dec 1, 2022
2 parents cea83a2 + 8b69a77 commit e68969f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/model_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ void ModelInterface::InitializePieces() {
}
}

// Allow sentencepiece to encode literate "<unk>" tokens in the raw input.
user_defined_symbols.insert("<unk>");

matcher_ = absl::make_unique<normalizer::PrefixMatcher>(user_defined_symbols);
}

Expand Down

0 comments on commit e68969f

Please sign in to comment.