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-07-12 19:24:46 +0300
committerTaku Kudo <taku@google.com>2018-07-12 19:24:46 +0300
commit256c6f5bb731c567c897999e4dca35e171f3b212 (patch)
tree7684b61ae6a175a3e5fc6d9f3423261bae7fb6b1 /src/model_interface.cc
parent983c0f5aeb26d6963c3adef94b12e2ea1595dac9 (diff)
Added new API to get bos/eos/unk/pad ids
Diffstat (limited to 'src/model_interface.cc')
-rw-r--r--src/model_interface.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/model_interface.cc b/src/model_interface.cc
index 5cbb1a5..2e9d685 100644
--- a/src/model_interface.cc
+++ b/src/model_interface.cc
@@ -70,6 +70,11 @@ std::string PrefixMatcher::GlobalReplace(absl::string_view w,
return result;
}
+const char ModelInterface::kUNK[] = "<unk>";
+const char ModelInterface::kBOS[] = "<s>";
+const char ModelInterface::kEOS[] = "</s>";
+const char ModelInterface::kPAD[] = "<pad>";
+
ModelInterface::ModelInterface(const ModelProto &model_proto)
: model_proto_(&model_proto), status_(util::OkStatus()) {}
ModelInterface::~ModelInterface() {}