Created
June 6, 2022 12:20
-
-
Save BURG3R5/0b2c95e0e3f3afac43298547bc291dba 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
# IN: string | |
for punctuation in "!()-[]{};:, <>./?@#$%^&*_~'\"\\": | |
string = string.replace(punctuation, " ") | |
string = string.lower() | |
tokens = word_tokenize(string) | |
tokens = [token for token in tokens if token not in stopwords.words()] | |
# OUT: tokens |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment