bgram = bigrams(sentences) trigram = trigrams(sentences)
并要计算困惑:
p = bgram.perplexity
AttributeError:“生成器”对象没有属性“困惑”
困惑应该如何计算?