sqy-harshil commited on
Commit
ef2509f
·
1 Parent(s): cc0c71f

Create helper.py

Browse files
Files changed (1) hide show
  1. helper.py +9 -0
helper.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ from fuzzywuzzy import fuzz, process
2
+ from constants import builders
3
+
4
+
5
+ def find_best_match(query):
6
+ best_matches = process.extractBests(query, choices=builders, scorer=fuzz.token_set_ratio, limit=3)
7
+ best_matches.insert(0, " ")
8
+ return "\n".join([str(item[0]) for item in best_matches])
9
+