SafeSpaceAI / src /nlp /preprocess.py
Shreya Pal
Make API Key private
5c5b473
raw
history blame contribute delete
181 Bytes
import re
def clean_text(text):
text = text.lower()
text = re.sub(r"http\S+", "", text) # remove links
text = re.sub(r"[^a-zA-Z\s]", "", text)
return text.strip()