ccks_baidu_entity_link
ccks_baidu_entity_link copied to clipboard
关于字典树的正向最大实体搜索
代码中正向最大实体搜索search_entity似乎有点问题,例如:
trie_obj = Trie()
en_lst = ["大话", "大话英雄"] # 假设树就这2个节点
for en in en_lst:
trie_obj.insert(en)
# text = "大话英雄" # 会输出【大话英雄】
# text = "大话" # 会输出【大话】
text = "大话英熊" # 程序不会输出预想的【大话】
match_lst = trie_obj.search_entity(text)
print(match_lst)
当text为"大话英熊"时我想应该要识别出【大话】这个实体,但是程序没有,请问这是一个bug吗,还是作者故意这么设计的呢?
@qingyujean 你好,请问这个问题最后有解决方案吗