Guest User

Untitled

a guest
Nov 16th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Tweets_mix = []
  2. for i, row in enumerate(sentence_snowstemmeed):
  3. all_row = ""
  4. for sent in row:
  5. all_row += sent
  6. Tweets_mix.append(all_row)
  7.  
  8. tfidf_model = TfidfVectorizer(max_df=0.8, max_features=1000,
  9. min_df=0.2, stop_words='english',
  10. use_idf=True, tokenizer=None, ngram_range=(1,1))
  11.  
  12. tfidf_matrix = tfidf_model.fit_transform(Tweets_mix) #fit the vectorizer to synopses
  13.  
  14. print ("In total, there are " + str(tfidf_matrix.shape[0]) + \
  15. " synoposes and " + str(tfidf_matrix.shape[1]) + " terms.")
Add Comment
Please, Sign In to add comment