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