File size: 281 Bytes
455555b |
1 2 3 4 5 6 7 8 9 10 |
import re
def clean_text(text):
"""Removes unnecessary spaces, special characters, and formats text properly."""
return re.sub(r'\s+', ' ', text).strip()
def normalize_score(score):
"""Ensures the score is within the range 0 to 1."""
return max(0, min(score, 1))
|