Created
October 30, 2019 05:41
-
-
Save aashish-chaubey/d22991f1fd87feedfbe816c77b47fd5e to your computer and use it in GitHub Desktop.
Using the fuzzywuzzy package to calculate the distance between 2 strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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