How to get PMI scores for trigrams with NLTK Collocations? python
问题 I know how to get bigram and trigram collocations using NLTK and I apply them to my own corpora. The code is below. My only problem is how to print out the birgram with the PMI value? I search NLTK documentation multiple times. It's either I'm missing something or it's not there. import nltk from nltk.collocations import * myFile = open("large.txt", 'r').read() myList = myFile.split() myCorpus = nltk.Text(myList) trigram_measures = nltk.collocations.TrigramAssocMeasures() finder =