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

Grouping issue when TFIDF.min_similarity < link_min_similarity #40

Open
colasri opened this issue Jul 22, 2022 · 1 comment
Open

Grouping issue when TFIDF.min_similarity < link_min_similarity #40

colasri opened this issue Jul 22, 2022 · 1 comment

Comments

@colasri
Copy link

colasri commented Jul 22, 2022

In the code below (with output in attached picture) I perform a simple TFIDF matching of ["apple", "apples", "appl", "recal", "happy"].

The initial min_similarity is set to 0.2. The similarity of happy and appl is 0.24.

When grouping with a link_min_similarity of 0.5, happy should not belong in the apples group, though that's what happens in the output of .get_matches(), it is in the apples group.

It appears it is not in the cluster though.

grouping

Plain text code:

from polyfuzz import PolyFuzz
from polyfuzz.models import TFIDF

from_list = ["apple", "apples", "appl", "recal", "happy"]
matcher = TFIDF(min_similarity=0.2)
model = PolyFuzz(matcher).match(from_list)
cm = model.cluster_mappings
model.group(link_min_similarity=0.5, group_all_strings=True)
print(model.get_matches())
@MaartenGr
Copy link
Owner

I am not entirely sure but there seems to be an issue with the group_all_strings parameter combined with link_min_similarity. What most likely is happening is that (appl, apple) gets into the cluster apples and (happy, appl) gets into the same cluster because it shared appl. I'll have to dig a little deeper to figure this stuff out but I'll make sure it gets released in the next version!

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

2 participants