nltk language model (ngram) calculate the prob of a word from context

后端 未结 4 1406
遇见更好的自我
遇见更好的自我 2020-12-13 21:14

I am using Python and NLTK to build a language model as follows:

from nltk.corpus import brown
from nltk.probability         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 21:36

    I would stay away from NLTK's NgramModel for the time being. There is currently a smoothing bug that causes the model to greatly overestimate likelihoods when n>1. If you do end up using NgramModel, you should definitely apply the fix mentioned in the git issue tracker here: https://github.com/nltk/nltk/issues/367

提交回复
热议问题