I'm building a text generate model using nltk.lm.MLE
, I notice they also have nltk.lm.Laplace
that I can use to smooth the data to avoid a division by zero, the documentation is
https://www.nltk.org/api/nltk.lm.htmlHowever, there's no clear example on how to use this function to smooth out test data. Can anyone kindly provides me an example.