Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
update similarity_distance weights
  • Loading branch information
huyingxi authored Dec 30, 2017
1 parent de23685 commit 54a978e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions synonyms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

1 comment on commit 54a978e

@hailiang-wang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huyingxi 这个是新的参数?可以发布了?

Please sign in to comment.