Files
trading_gnn/src/utils/text_processing.py
T
2026-05-26 13:51:02 +02:00

13 lines
262 B
Python

"""
Text processing utilities for sentiment and news analysis.
"""
import re
def clean_text(text: str) -> str:
"""Clean and normalize text."""
text = re.sub(r"http\S+", "", text)
text = re.sub(r"[^\w\s]", "", text)
return text.strip().lower()