{"data":{"slug":"maartengr-polyfuzz","name":"PolyFuzz","tagline":"Fuzzy string matching, grouping and evaluation","github_url":"https://github.com/MaartenGr/PolyFuzz","owner":"MaartenGr","repo":"PolyFuzz","owner_avatar_url":"https://avatars.githubusercontent.com/u/25746895?v=4","primary_language":"Python","stars":801,"forks":72,"topics":["bert","edit-distance","embeddings","levenshtein-distance","string-matching","tf-idf"],"archived":false,"github_pushed_at":"2025-07-10T05:10:46+00:00","maintenance_label":"Dormant","stars_delta_30d":1,"url":"https://www.graphcanon.com/tools/maartengr-polyfuzz","markdown_url":"https://www.graphcanon.com/tools/maartengr-polyfuzz.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/maartengr-polyfuzz","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=maartengr-polyfuzz","description":"Fuzzy string matching, grouping, and evaluation. ","homepage_url":"https://maartengr.github.io/PolyFuzz/","license":"MIT","open_issues":32,"watchers":11,"ai_summary":"PolyFuzz is a Python library for fuzzy string matching which leverages methods such as BERT embeddings, edit distance, Levenshtein distance, and TF-IDF to match strings within datasets.","readme_excerpt":"## Installation\nYou can install **`PolyFuzz`** via pip:\n \n```bash\npip install polyfuzz\n```\n\nYou may want to install more depending on the transformers and language backends that you will be using. The possible installations are:\n\n```python\npip install polyfuzz[sbert]\npip install polyfuzz[flair]\npip install polyfuzz[gensim]\npip install polyfuzz[spacy]\npip install polyfuzz[use]\n```\n\nIf you want to speed up the cosine similarity comparison and decrease memory usage when using embedding models, \nyou can use `sparse_dot_topn` which is installed via:\n\n```bash\npip install polyfuzz[fast]\n```\n\n<details>\n<summary>Installation Issues</summary>\n\nYou might run into installation issues with `sparse_dot_topn`. If so, one solution that has worked for many \nis by installing it via conda first before installing PolyFuzz:\n\n```bash\nconda install -c conda-forge sparse_dot_topn\n```\n\nIf that does not work, I would advise you to look through their \nissues](https://github.com/ing-bank/sparse_dot_topn/issues) page or continue to use PolyFuzz without `sparse_dot_topn`. \n\n</details>  \n\n\n<a name=\"gettingstarted\"/></a>\n\n---\n\n## Getting Started\n\nFor an in-depth overview of the possibilities of `PolyFuzz` \nyou can check the full documentation [here](https://maartengr.github.io/PolyFuzz/) or you can follow along \nwith the notebook [here](https://github.com/MaartenGr/PolyFuzz/blob/master/notebooks/Overview.ipynb).\n\n---\n\n### Quick Start\n\nThe main goal of `PolyFuzz` is to allow the user to perform different methods for matching strings. \nWe start by defining two lists, one to map from and one to map to. We are going to be using `TF-IDF` to create \nn-grams on a character level in order to compare similarity between strings. Then, we calculate the similarity \nbetween strings by calculating the cosine similarity between vector representations. \n\nWe only have to instantiate `PolyFuzz` with `TF-IDF` and match the lists:\n\n```python\nfrom polyfuzz import PolyFuzz\n\nfrom_list = [\"apple\", \"apples\", \"appl\", \"recal\", \"house\", \"similarity\"]\nto_list = [\"apple\", \"apples\", \"mouse\"]\n\nmodel = PolyFuzz(\"TF-IDF\")\nmodel.match(from_list, to_list)\n```  \n\nThe resulting matches can be accessed through `model.get_matches()`:\n\n```python\n>>> model.get_matches()\n         From      To    Similarity\n0       apple   apple    1.000000\n1      apples  apples    1.000000\n2        appl   apple    0.783751\n3       recal    None    0.000000\n4       house   mouse    0.587927\n5  similarity    None    0.000000\n\n``` \n\n**NOTE 1**: If you want to compare distances within a single list, you can simply pass that list as such: `model.match(from_list)`\n\n**NOTE 2**: When instantiating `PolyFuzz` we also could have used \"EditDistance\" or \"Embeddings\" to quickly \naccess Levenshtein and FastText (English) respectively.","github_created_at":"2020-11-21T06:28:09+00:00","created_at":"2026-07-11T11:32:17.105447+00:00","updated_at":"2026-08-22T18:02:17.066296+00:00","categories":[{"slug":"data-retrieval","name":"Data & Retrieval","url":"https://www.graphcanon.com/categories/data-retrieval","markdown_url":"https://www.graphcanon.com/categories/data-retrieval.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/data-retrieval"},{"slug":"evaluation-observability","name":"Evaluation & Observability","url":"https://www.graphcanon.com/categories/evaluation-observability","markdown_url":"https://www.graphcanon.com/categories/evaluation-observability.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/evaluation-observability"}],"tags":[{"slug":"bert","name":"bert"},{"slug":"edit-distance","name":"edit-distance"},{"slug":"embeddings","name":"embeddings"},{"slug":"levenshtein-distance","name":"levenshtein-distance"},{"slug":"string-matching","name":"string-matching"},{"slug":"tf-idf","name":"tf-idf"}],"trust":{"provenance":{"is_fork":false,"github_id":314748658,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-22T18:02:16.291Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":408,"last_release_at":"2025-05-06T11:58:23Z","stars_delta_30d":1,"open_issues_delta_30d":0},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T11:32:18.351Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-22T18:02:16.745Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-08-22T18:02:16.745Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-08-22T18:02:16.745Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["Use PolyFuzz when your project requires deep semantic similarity detection with BERT embeddings alongside traditional string metrics.","Consider it for projects where the robust evaluation of match quality is essential through integrated scoring methods."],"when_not_to_use":["Avoid using PolyFuzz if you aim to match very short strings since Levenshtein distance and edit distance may dominate over BERT's nuances.","Steer clear if runtime speed is a priority, as embedding computations can be resource-intensive compared to purely algorithmic methods."],"source":"enrich:decision_facts","observed_at":"2026-07-17T03:13:53.491Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"PolyFuzz leverages advanced methods like BERT embeddings, edit distance, Levenshtein distance, and TF-IDF for sophisticated fuzzy string matching in Python datasets."}]}}