Guest User

Untitled

a guest
Oct 20th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. word_frequency = nltk.FreqDist(merged_lemmatizedTokens) #obtains frequency distribution for each token
  2. print("nMost frequent top-10 words: ", word_frequency.most_common(10))
  3. word_frequency.plot(10, title='Top 10 Most Common Words in Corpus')
  4. plt.savefig('img_top10_common.png')
  5.  
  6. plt.ion()
  7. word_frequency.plot(10, title='Top 10 Most Common Words in Corpus')
  8. plt.savefig('img_top10_common.png')
  9. plt.ioff()
  10. plt.show()
Add Comment
Please, Sign In to add comment