You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
预期中应该讲整个句子作为一个词,将源码 ltp.algorithms.Trie 的 maximum_forward_matching 方法中的代码 while end <= text_len and curr_len < max_len: 修改为 while end <= text_len and curr_len <= max_len 则可以正确切分。
即将 < 修改为 <=
Activity
wangyuxinwhy commentedon Dec 28, 2020
按照上方的修改后,同样的代码,输出如下:
[['跟谁学']], {'word_cls': tensor([[[-4.0777e-01, 4.0268e-01, 1.2457e-01, -1.5838e- ...
这个感觉更符合直觉。
AlongWY commentedon Dec 28, 2020
应该是写错了,不过问题不在这,是由于分词 TAG 导致的问题
修复由于分词词表带来的切分不一致问题 #466
AlongWY commentedon Dec 28, 2020
稍后你可以试一下 4.1.3.post1 版本,我测试了一下已经修复了这个问题