In [5]:
def clean_special_chars(text, punct):
for p in punct:
text = text.replace(p, ' ')
return text
In [8]:
text = "Hi, Welcome to machinelearning korea (very good), ^.^"
punct = "/-'?!.,#$%\'()*+-/:;<=>@[\\]^_`{|}~`" + '""“”’' + '∞θ÷α•à−β∅³π‘₹´°£€\×™√²—–&'
In [9]:
clean_special_chars(text, punct)
Out[9]: