fgar13
Add ASL Qwen training pipeline
babffc8
Raw
History Blame Contribute Delete
628 Bytes
from __future__ import annotations
import re
import unicodedata
def normalize_label(text: str) -> str:
text = unicodedata.normalize("NFKC", str(text))
text = text.strip().lower()
text = text.replace("_", " ").replace("-", " ")
text = re.sub(r"\s+", " ", text)
text = re.sub(r"^[\"'`]+|[\"'`]+$", "", text)
text = re.sub(r"[^\w\s]", "", text)
return text.strip()
def normalize_text(text: str) -> str:
text = unicodedata.normalize("NFKC", str(text))
text = text.strip().lower()
text = re.sub(r"\s+", " ", text)
text = re.sub(r"^[\"'`]+|[\"'`]+$", "", text)
return text.strip()