Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import nltk
  2. from nltk.corpus import stopwords
  3. example_sentence = "this is an example showing off stop words filtration."
  4. stop_words = set(stopwords. words("english"))
  5. words = word_tokenize(example_sentence)
  6. filtered_sentence = []
  7.  
  8. for w in words:
  9.     if w not in stop_words:
  10.         print(filtered_sentence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement