Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nltk
- from nltk.corpus import stopwords
- example_sentence = "this is an example showing off stop words filtration."
- stop_words = set(stopwords. words("english"))
- words = word_tokenize(example_sentence)
- filtered_sentence = []
- for w in words:
- if w not in stop_words:
- print(filtered_sentence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement