File size: 223 Bytes
826af0d
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import re
import string

def preprocess_text(text):
    # Example of a preprocessing function that used in Week 1 & 2
    text = text.lower()
    text = re.sub(f"[{re.escape(string.punctuation)}]", "", text)
    return text