未验证 提交 54a978e6 编写于 作者: H huyingxi 提交者: GitHub

Update __init__.py

update similarity_distance weights
上级 de23685f
......@@ -219,8 +219,8 @@ def _similarity_distance(s1, s2):
# https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.norm.html
g = 1 / (np.linalg.norm(a - b) + 1)
u = _levenshtein_distance(s1, s2)
r = g * 1.4 + u * 0.2
r = min((r * 10 + 0.1), 1.0)
r = g * 1.8 + u * 0.4
r = min((r * 18), 1.0)
return float("%.3f" % r)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册