Created
September 7, 2023 22:53
-
-
Save fsndzomga/5061d631fe2b6399ffd2e67d74c41fab to your computer and use it in GitHub Desktop.
stop words
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
from spacy.lang.en.stop_words import STOP_WORDS | |
sentence = "This is a sample sentence." | |
doc = nlp(sentence) | |
filtered_tokens = [token.text for token in doc if token.text.lower() not in STOP_WORDS] | |
print(filtered_tokens) | |
# Output: ['sample', 'sentence', '.'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment