Reputation: 75
I am using fuzzy pattern matching on a large dataset and its time complexity is O(n). I want to reduce execution time.
Is there any alternate way to do this?
Here is my code
for k in range(len(patterns)):
#patterns is list converted from dataframe of the dataset
res = int(fuzz.partial_ratio(word,patterns[k]))
rank[k]= res
per.insert(k,res)
Upvotes: 1
Views: 639
Reputation: 92
You can make a cutoff and match among the top 10 instead of the entire dataset
Here is the function
Fuzzy Wuzzy String Matching on 2 Large Data Sets Based on a Condition - python
Upvotes: 1