title: remove stopwords and tokenize for collocationbigramfinder NLTK
body: <p>I keep getting this error </p>
  
  <pre><code>sub
      return _compile(pattern, flags).sub(repl, string, count)
  TypeError: expected string or buffer
  </code></pre>
  
  <p>when i try to run this script. Not sure what is wrong. I am essentially reading from a text file, filtering out the stopwords and tokenizing them using NLTK. </p>
  
  <pre><code>import nltk
  from nltk.collocations import *
  from nltk.tokenize import word_tokenize
  from nltk.corpus import stopwords
  
  stopset = set(stopwords.words('english'))
  bigram_measures = nltk.collocations.BigramAssocMeasures()
  trigram_measures = nltk.collocations.TrigramAssocMeasures()
  
  
  text_file=open('sentiment_test.txt', 'r')
  lines=text_file.readlines()
  filtered_words = [w for w in lines if not w in stopwords.words('english')]
  print filtered_words
  tokens=word_tokenize(str(filtered_words)
  print tokens
  finder = BigramCollocationFinder.from_words(tokens)
  </code></pre>
  
  <p>Any help would be much appreciated. </p>