Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aashish-chaubey/d22991f1fd87feedfbe816c77b47fd5e to your computer and use it in GitHub Desktop.
Save aashish-chaubey/d22991f1fd87feedfbe816c77b47fd5e to your computer and use it in GitHub Desktop.
Using the fuzzywuzzy package to calculate the distance between 2 strings
### Using the fuzzywuzzy package
fuzzywuzzy package in python implements the Lavenshtein distance between two string to calculate the similarity between the two.
Install 2 packages:
pip install fuzzywuzzy
pip install python-Levenshtein / conda install -c conda-forge python-levenshtein
`[I actually had an issue installing the package, so I used the conda installation for this this package]`
This package is required to suppress the warning for the default slow fuzzywuzzy package.
It apparently works well with python-levenshtein package.
We can use many powerful functions in the python-levenshtein package like the
- *ratio*,
- *partial_ratio*,
- *token_sort_ratio*,
- *token_set_ratio*.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment