GithubHelp home page GithubHelp logo

PartialRatio issue about fuzzywuzzy HOT 4 OPEN

xdrop avatar xdrop commented on June 19, 2024 1
PartialRatio issue

from fuzzywuzzy.

Comments (4)

ACE07-Sev avatar ACE07-Sev commented on June 19, 2024

why does this and this return as 100 percent matched?
String s1 = "cant display the icon";
String s2 = "cant display screen";

from fuzzywuzzy.

maxbachmann avatar maxbachmann commented on June 19, 2024

why does this and this return as 100 percent matched?

The correct result would be 74, so a result of 100 would be a bug.

from fuzzywuzzy.

ACE07-Sev avatar ACE07-Sev commented on June 19, 2024

so it's wrong right?

from fuzzywuzzy.

maxbachmann avatar maxbachmann commented on June 19, 2024

In rapidfuzz I implement this metric using a sliding window approach, which skips comparisons only if it is really sure they can not occur. When searching for long needles (> 64 characters) this is slower than the approach using get matching blocks. However it is the only way I am aware of, that is guaranteed to return the correct alignment. The current implementation has the following issues:

  1. the implementation backtracking the Levenshtein matrix is not guaranteed to return the longest common subsequences (which difflib does). It would be possible to find this, but it would make it a lot slower, since it would require backtracking multiple times to find it.
  2. even when using the implementation from difflib, it is fundamentally flawed, since there is no guarantee for the optimal alignment to start at the same place as one of the longest common subsequences
  3. the metric allows the matched substring to be shorter if it is placed at the end of the sequence. However to make the metric symmetric the same needs to be allowed at the start of the sequence.

Especially the second issue is a fundamental flaw in the way this algorithm currently works.

from fuzzywuzzy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.