title: How I can create a matrix template for checking sentences similarity?
body: <p>I'm new to text mining and python and I'm trying to do a simple task.
  I want to create TF matrix from sentences:
  ['This is the first sentence','This is the second sentence', 'This is the third sentence']</p>
  
  <p>And in loop (or somehow) compare new sentences with this matrix.</p>
  
  <p>On stackoverflow I've found good example wich works fine, but in my case it would calculate TF matrix for sample sentences and new sentences each time. It will work a bit slow on large datasets.</p>
  
  <pre><code>from sklearn.feature_extraction.text import TfidfVectorizer
  
  vect = TfidfVectorizer()
  text = []
  text = ['This is the first sentence','This is the second sentence', 'This is the third sentence']
  text.append('new sentence')
  tfidf = vect.fit_transform(text)
  
  # Get an array of results
  results = ( tfidf * tfidf.T ).A
  </code></pre>
  
  <p>I want to know how to do it in other more accurate way, thanks.</p>