I am new to python and nltk, and I want to find the frequency of bigrams in a text (string), and then sort the bigrams from highest to lowest frequency. I have found the bigrams and the frequencies using:
tokens = nltk.word_tokenize(text)
bgs = nltk.bigrams(tokens
fdist = nltk.FreqDist(bgs)
But I dont know how to sort it from highest to lowest frequency?
I know it is probably easy, but I cant figure it out. Hope someone will help me!