brd-audit-streamlit-is / utils /preprocess.py
Pachinee's picture
Create preprocess.py
cf59e1e verified
Raw History Blame Contribute Delete
126 Bytes
import re
def preprocess_text(text: str) -> str:
text = text.strip()
text = re.sub(r"\s+", " ", text)
return text