import re import string def clean_text(text: str) -> str: """Lowercase, remove punctuation, and clean text""" text = text.lower() text = re.sub(f"[{re.escape(string.punctuation)}]", "", text) text = text.strip() return text