Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2018-04-09 11:47:42 +0300
committerTaku Kudo <taku@google.com>2018-04-09 11:47:42 +0300
commitd1028974960d9e7ac9b408f6c212aa90d7c958cb (patch)
tree4cda91a55a068786d91e6d78afb294b494fd9e3c /src/bpe_model.cc
parent8ff70f28bd33368af3a9d7c74b672a1d9bb01095 (diff)
Support to change ids of <unk>, <s>, </s>
Diffstat (limited to 'src/bpe_model.cc')
-rw-r--r--src/bpe_model.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bpe_model.cc b/src/bpe_model.cc
index fdc5fd7..fe9df73 100644
--- a/src/bpe_model.cc
+++ b/src/bpe_model.cc
@@ -22,7 +22,6 @@ namespace bpe {
Model::Model(const ModelProto &model_proto) {
model_proto_ = &model_proto;
- CheckControlSymbols();
for (int i = 0; i < model_proto_->pieces_size(); ++i) {
const auto &sp = model_proto_->pieces(i);
@@ -35,6 +34,7 @@ Model::Model(const ModelProto &model_proto) {
LOG(FATAL) << "User defined symbol is not supported in BPE";
} else {
port::InsertOrDie(&reserved_id_map_, sp.piece(), i);
+ if (sp.type() == ModelProto::SentencePiece::UNKNOWN) unk_id_ = i;
}
}
}