short_context_search.py 文件源码

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

项目:Hanhan_NLP 作者: hanhanwu 项目源码 文件源码
def closest_token(stemmed_token_lst, merchant_info):
  min_dist = sys.maxint  # only use the min_dist for all as the score
  merchant_tokens = [stemmer.stem(m) for m in merchant_info.split()]  # stem merchant tokens here
  for t in stemmed_token_lst:
    for m in merchant_tokens:
      tmp_dist = distance(t, m)
      if min_dist > tmp_dist:
        min_dist = tmp_dist
  return min_dist
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号