f = open('a_text_file')
raw = f.read()
tokens = nltk.word_tokenize(raw)
bgs = nltk.bigrams(tokens)
fdist = nltk.FreqDist(bgs)
for k, v in list(fdist.items()):
    pass
counting n-gram frequency in python nltk