purpleriann's picture
Upload folder using huggingface_hub
a22e84b verified
raw
history blame contribute delete
153 Bytes
import re
def clean_text(text: str) -> str:
text = re.sub(r"[^\w\s.,!?]", " ", text)
text = re.sub(r"\s+", " ", text)
return text.strip()