 A common approach is to generate a maximum-likelihood model for the entire collection and linearly interpolate the collection model with a maximum-likelihood model for each document to smooth the model.In an "n"-gram model, the probability formula_1 of observing the sentence formula_9 is approximated as

It is assumed that the probability of observing the "ith" word "wi" in the context history of the preceding "i" − 1 words can be approximated by the probability of observing it in the shortened context history of the preceding "n" − 1 words ("n"th order Markov property).The conditional probability can be calculated from "n"-gram model frequency counts