Python: 3.6.8
nltk: 3.5.0
I am new to nltk and also a NLP newbie. Recently I am trying to generate a bigram language model from a corpus with Katz Backoff smoothing, with which I can calculate the text's probability in this corpus.
I noticed that there is some possible methods in NLTK 3.0.0 documentation (http://www.nltk.org/_modules/nltk/model/ngram.html#NgramModel), which is abandoned in version 3.5.0.
Since I want to generate the bigram language model with Katz Backoff smoothing with nltk’s latest version, can anyone give me some help or suggestions on how to do this?
1条答案
按热度按时间thtygnil1#
该模块已被此模块取代。尚未实现回退模型,但您可以尝试使用插值模型作为起点。该模块还设计为提供构建块,使您能够组装类似于Katz Backoff的东西。