Created
September 1, 2018 00:23
-
-
Save emmagrimaldi/a2df5cb37859affb5b0b9dcf85685d8c to your computer and use it in GitHub Desktop.
clean_tokens
This file contains hidden or 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
| # importing the library needed in this section | |
| from nltk.corpus import stopwords | |
| # assigning the english stop-words to the sw list | |
| sw = stopwords.words('english') | |
| # assigning the non stop-words contained in the tokens list | |
| # to a new list named clean_tokens through a list comprehension | |
| clean_tokens = [token for token in tokens if token not in sw] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment