Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect JaroWinkler similarity score #43

Open
binh-vu opened this issue Apr 22, 2023 · 0 comments
Open

Incorrect JaroWinkler similarity score #43

binh-vu opened this issue Apr 22, 2023 · 0 comments

Comments

@binh-vu
Copy link

binh-vu commented Apr 22, 2023

RLTK returns incorrect score for Jaro Winkler similarity metric for the following pair: ("United Kingdom", "Sengenia (United Kingdom)").

Test:

import jaro
import rltk.similarity as sim
import py_stringmatching.similarity_measure.jaro_winkler
import py_stringmatching.similarity_measure.jaro
import rapidfuzz.distance

key = "United Kingdom"
query = "Sengenia (United Kingdom)"

print(sim.jaro_winkler_similarity(key, query, threshold=0.7, scaling_factor=0.1, prefix_len=4))
jw = py_stringmatching.similarity_measure.jaro_winkler.JaroWinkler(); print(jw.get_raw_score(key, query))
print(jaro.jaro_winkler_metric(key, query))
print(rapidfuzz.distance.JaroWinkler.similarity(key, query, score_cutoff=0.7, prefix_weight=0.1))

Output:

0.5054761904761905
0.7342857122421265
0.7342857142857143
0.7342857142857143

Similarly, the Jaro metric is also incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant