short_context_search.py 文件源码

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

项目:Hanhan_NLP 作者: hanhanwu 项目源码 文件源码
def closest_token(stemmed_token_lst, merchant_info):
  score = 0
  merchant_tokens = merchant_info.split()  # only split works in merchant_info
  for t in stemmed_token_lst:
    min_dist = sys.maxint
    for m in merchant_tokens:
      tmp_dist = distance(t, m)
      if min_dist > tmp_dist:
        min_dist = tmp_dist
    score += min_dist
  return score
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号