正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
| @@ -214,7 +214,9 @@ std::vector<int64_t> Lexicon::ConvertTextToTokenIdsChinese( | @@ -214,7 +214,9 @@ std::vector<int64_t> Lexicon::ConvertTextToTokenIdsChinese( | ||
| 214 | 214 | ||
| 215 | for (const auto &w : words) { | 215 | for (const auto &w : words) { |
| 216 | if (punctuations_.count(w)) { | 216 | if (punctuations_.count(w)) { |
| 217 | - if (sil != -1) { | 217 | + if (token2id_.count(w)) { |
| 218 | + ans.push_back(token2id_.at(w)); | ||
| 219 | + } else if (sil != -1) { | ||
| 218 | ans.push_back(sil); | 220 | ans.push_back(sil); |
| 219 | } | 221 | } |
| 220 | continue; | 222 | continue; |
-
请 注册 或 登录 后发表评论