Manasa1 commited on
Commit
32d0fec
·
verified ·
1 Parent(s): 3b03cca

Update tweet_analyzer.py

Browse files
Files changed (1) hide show
  1. tweet_analyzer.py +2 -1
tweet_analyzer.py CHANGED
@@ -116,7 +116,8 @@ class TweetDatasetProcessor:
116
  nmf_model.fit(tfidf_matrix)
117
  topics = []
118
  for topic_idx, topic in enumerate(nmf_model.components_):
119
- topic_words = [vectorizer.get_feature_names_out()[i] for i in topic.argsort()[:-n_topics - 1:-1]]
 
120
  topics.append(" ".join(topic_words))
121
  return topics
122
 
 
116
  nmf_model.fit(tfidf_matrix)
117
  topics = []
118
  for topic_idx, topic in enumerate(nmf_model.components_):
119
+ topic_words = [vectorizer.get_feature_names_out()[i]
120
+ for i in topic.argsort()[:-n_topics - 1:-1]]
121
  topics.append(" ".join(topic_words))
122
  return topics
123