13 lines
262 B
Python
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()
|