修复get_text_idx函数,将中文词转为id时最后一个词匹配错误的bug #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
你好,在研究你的代码的时候,发现get_text_idx函数的处理稍有瑕疵,个人进行一些调整,望能并入给更多人的看到。
仔细地说,举个例子。
文本中:”0 标准间 太 差 房间 不如 星 而且 设施 非常 陈旧 建议 酒店 把 老 标准间 从 新 改善 “
你原来最后一个单词为[...,'改善\n'],无法匹配到词库中到id,匹配到unknown。
详见代码,欢迎交流