Take for instance equation 67 and 68 from this chapter:

  • the value of $P(q|R=1,q)$ can become zero if the term is not present in the document, and
  • as all probabilities are multiplied, the probability over the whole document will become zero.

It seems that $P(d|R=1,q)$ will always come to zero as soon as some of the index terms are missing in the document?

  • 1
    $\begingroup$ I'm not sure whether this question is on-topic here. If it is not, it might be better-suited to Cross Validated or Computer Science. $\endgroup$
    – D.W.
    Oct 2, 2013 at 5:11
  • 1
    $\begingroup$ I don't think this is appropriate here. It's not clear if this is really theoretical computer science, but even if we accepted it were, it is far from research-level. $\endgroup$ Dec 1, 2013 at 15:19

1 Answer 1


Yes, when implementing this sort of thing in practice, one has to be careful that this doesn't screw you up. If you're not careful, when trying to estimate the probability of a term that doesn't appear in the document, you might mistakenly estimate its probability as 0 (e.g., if your estimate of its probability is the number of times it appears in the document divided by the number of words in the document). However, the actual probability is almost certainly not 0.

A standard workaround is to use Laplace smoothing, add-one smoothing, Bayesian smoothing, or another similar method.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.