Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Dec 20, 2020
Embed
What would you like to do?
def clean_text(txt):
txt = "".join(v for v in txt if v not in string.punctuation).lower()
txt = txt.encode("utf8").decode("ascii",'ignore')
return txt
corpus = [clean_text(x) for x in all_headlines]
corpus[:10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment