Last active
June 24, 2021 02:29
-
-
Save bhavbhavyaa/ce00417975ae4ef8e3324f4d05f20151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clean(doc): | |
tokens = doc.split() | |
table = str.maketrans("","",string.punctuation) | |
tokens = [w.translate(table) for w in tokens] | |
tokens = [word for word in tokens if word.isalpha()] | |
tokens = [word.lower() for word in tokens] | |
return tokens | |
tokens = clean(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment