Skip to content

Instantly share code, notes, and snippets.

@ken333135
Created June 19, 2018 02:38
Show Gist options
  • Save ken333135/d85c752c4b8ba3f7eac16630f6d1aadd to your computer and use it in GitHub Desktop.
Save ken333135/d85c752c4b8ba3f7eac16630f6d1aadd to your computer and use it in GitHub Desktop.
Get Top words for each class (multi-class text classification)
top_words = []
#loop to find top 5 words of each class in the dataset
for code in vect_data.index:
top_words.append([code,find_top_words(code,5)])
#print the list of top words
top_words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment