chatbot / src /preprocess.py
Vivekkrishu's picture
update
f3287af
raw
history blame contribute delete
245 Bytes
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