File size: 242 Bytes
260c0bf
 
658e2df
 
 
 
 
 
1
2
3
4
5
6
7
8
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