Chatbot / chatbot /src /preprocess.py
Vivekkrishu's picture
Upload 18 files
7678704 verified
raw
history blame contribute delete
254 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