Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

problem of fuzz.ratio with newer ver (22) of python-Lev. distance #334

Description

@orellavie1212

Hey,
After testing failure of fuzz.ratio at the detection of basic sim. match, I found that the newer ver of python-Levenshtein(0.22.0) makes the fuzz.ratio output wrong answer when installing it with fuzzywuzzy (latest version of fuzzy).
Here is an example of the wrong output:
code:
from fuzzywuzzy import fuzz
list_to_search_from = ['Barcelona', 'Real Madrid']
text_to_search = 'real'
scores = {search_option: fuzz.ratio(search_option, text_to_search) for search_option in list_to_search_from}
output:
{‘Barcelona’: 46, ‘Real Madrid’: 40}
with ver 21.1
{'Barcelona': 31, 'Real Madrid': 40}
which is the right answer.

After downgrade to 21.1 it works nice, didn't find where it fails on 22. Note, without python-Levenshtein install at all (clean, checked with colab with and without) it works like a charm. Wonder why it happens (maybe wrong calc of Lev. dist at the new ver)
!pip install python-Levenshtein==0.21.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions