UChicago-CCA-2021 / Frequently-Asked-Questions

Repository to ask questions - please use the issues page to ask your questions.
0 stars 0 forks source link

plotting word probability distribution #18

Open lilygrier opened 3 years ago

lilygrier commented 3 years ago

Hello, Exercise 2 asks us to plot the word frequency distribution as well as the word probability distribution created from the word frequency distribution. My code for creating the probability distribution is as follows: clim_bills_cpdist = nltk.ConditionalProbDist(clim_bills_cfdist, nltk.ELEProbDist)

The clim_bills_cfdist is analogous to the whcfdist and plots fine. I am also able to plot conditional probability distributions, just not word probability distributions created from this 'ELEProbDist' object, which cannot be plotted. Advice would be appreciated!

Lily

bhargavvader commented 3 years ago

nltk also has a FreqDist module - check out https://www.nltk.org/_modules/nltk/probability.html, and this should help you get there!