Python -Matching Two Strings using AI Algorithm-Fuzzy

Publicado el: 15 julio 2020
en el canal de: Technical RPA
1,341
3

Different types of fuzzywuzzy ML algorithm to match two strings based on Ratio .
Here I am updating code for your reference.

#pip install fuzzywuzzy
from fuzzywuzzy import fuzz
#Fuzzy string matching like a boss.
#It uses Levenshtein Distance to calculate the differences between sequences in a simple-to-use package.

#Simple Ratio
simpleRatio=fuzz.ratio("this is a test", "this is a test!")
#print(simpleRatio)

#Partial Ratio
partialRatio=fuzz.partial_ratio("this is a test", "this is a test!")
#print(partialRatio)

#Token Sort Ratio
TokensortRatio1=fuzz.ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
#print(TokensortRatio1)

TokensortRatio2=fuzz.token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
#print(TokensortRatio2)

#Token Set Ratio
TokensortRatio3=fuzz.token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
#print(TokensortRatio3)

TokensortRatio4=fuzz.token_set_ratio("fuzzy was a bear", "fuzzy fuzzy fuzzy is a bear")
print(TokensortRatio4)


En esta página del sitio puede ver el video en línea Python -Matching Two Strings using AI Algorithm-Fuzzy de Duración hora minuto segunda en buena calidad , que subió el usuario Technical RPA 15 julio 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,341 veces y le gustó 3 a los espectadores. Disfruta viendo!