thai-bilstm-sentiment / utils /preprocess.py
Dusit-P's picture
Upload 11 files
284ba3b verified
raw
history blame contribute delete
157 Bytes
import re
def clean_text(text):
text = text.strip()
text = re.sub(r'[\n\r\t]', ' ', text)
text = re.sub(r'[ ]{2,}', ' ', text)
return text