Spaces:
Sleeping
Sleeping
| 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 |