ai-corp-platform / app /utils.py
ZELLOIN's picture
Upload 18 files
89a9fe5 verified
Raw
History Blame Contribute Delete
286 Bytes
import re
def preprocess_text(text: str) -> str:
# Удаление спецсимволов, приведение к нижнему регистру
text = text.lower()
text = re.sub(r'[^\w\s]', '', text)
text = re.sub(r'\s+', ' ', text).strip()
return text