diff options
author | Frank Seide <fseide@microsoft.com> | 2018-05-25 22:44:31 +0300 |
---|---|---|
committer | Frank Seide <fseide@microsoft.com> | 2018-05-25 22:44:31 +0300 |
commit | 3ee068a90f24071261806b253f2156a4d48a0374 (patch) | |
tree | 64e4f35a9593392053fc9bc3e0bc098eed439d53 /src/data/vocab.h | |
parent | 2280fd573db65ec25c28733ee463206f8bd45229 (diff) |
EOS_ID and UNK_ID are now determined from the loaded vocabulary file, instead of requiring hard-coded values
Diffstat (limited to 'src/data/vocab.h')
-rw-r--r-- | src/data/vocab.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/data/vocab.h b/src/data/vocab.h index 89dc9ccb..391083a1 100644 --- a/src/data/vocab.h +++ b/src/data/vocab.h @@ -35,6 +35,9 @@ public: void create(InputFileStream& trainStrm, OutputFileStream& vocabStrm, size_t maxSize = 0); + + Word GetEosId() const { return eosId_; } + Word GetUnkId() const { return unkId_; } private: typedef std::map<std::string, size_t> Str2Id; @@ -43,6 +46,9 @@ private: typedef std::vector<std::string> Id2Str; Id2Str id2str_; + Word eosId_ = -1; + Word unkId_ = -1; + class VocabFreqOrderer; }; } |