MachineLearning.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:entity-linker 作者: seucs 项目源码 文件源码
def getData(Mentions,S,E,contextMention,contextEntity, id):
    for mention in Mentions:
        jieba.add_word(mention.name)

        S.append(mention.name)
        id.append('-') #????????????
        contextMention[mention.name] = mention.context
    for item in Mentions:
        temp = []
        cnt = 0
        for candidate in item.candidates:
            if cnt > 100:
                break
            cnt += 1
            temp.append(candidate.title)
            contextEntity[candidate.title] = candidate.context

            id.append(candidate.id)
        E.append(temp)

# element{???mention/entity}
# ??element
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号