kalwebapp / utils /matcher.py
Clemenz88's picture
Upload 4 files
658e2df verified
raw
history blame contribute delete
242 Bytes
from rapidfuzz import process
def fuzzy_match(label: str, candidates: list) -> str:
key = label.replace("_", " ").lower()
match, score, _ = process.extractOne(key, candidates)
if score >= 70:
return match
return label