Skip to content

Commit

Permalink
Update to use WRatio for the score values.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanStoves committed May 16, 2024
1 parent d401065 commit b0815bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def search(
if len(partial_matches) > 1 or not partial_matches:
names = [key(d).lower() for d in list_to_search]
fuzzy_map = {key(d).lower(): d for d in list_to_search}
fuzzy_results = [r for r in process.extract(value.lower(), names, scorer=fuzz.ratio) if r[1] >= cutoff]
fuzzy_results = [r for r in process.extract(value.lower(), names, scorer=fuzz.WRatio) if r[1] >= cutoff]
fuzzy_sum = sum(r[1] for r in fuzzy_results)
fuzzy_matches_and_confidences = [(fuzzy_map[r[0]], r[1] / fuzzy_sum) for r in fuzzy_results]

Expand Down

0 comments on commit b0815bc

Please sign in to comment.