Skip to content

Instantly share code, notes, and snippets.

Created Dec 20, 2020
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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment