newsname-match.py 文件源码

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

项目:newsname-match 作者: bahadasx 项目源码 文件源码
def similarity(n1, n2):
    """
    Returns the mean of the partial_ratio score for each field in the two
    entities. Note that if they don't have fields that match, the score will
    be zero.
    """

    scores = [
        fuzz.partial_ratio(n1, n2)
        ]

    return float(sum(s for s in scores)) / float(len(scores))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号