<p>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.</p>

<p>A standard workaround is to use <a href="https://en.wikipedia.org/wiki/Additive_smoothing" rel="nofollow">Laplace smoothing</a>, add-one smoothing, Bayesian smoothing, or another similar method.</p>

CC BY-SA 3.0
2013-10-02T05:10:43.250Z
2013-10-02T05:10:43.250Z
D.W.
<p>Take for instance <a href="https://i.sstatic.net/JKuOy.png" rel="nofollow noreferrer">equation 67 and 68</a> from this <a href="http://nlp.stanford.edu/IR-book/html/htmledition/deriving-a-ranking-function-for-query-terms-1.html" rel="nofollow noreferrer">chapter</a>:</p>

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

<p>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?</p>

CC BY-SA 3.0
2013-10-02T05:11:44.753Z
I'm not sure whether this question is on-topic here.  If it is not, it might be better-suited to [stats.se] or [CS.SE].
D.W.
CC BY-SA 3.0
2013-12-01T15:19:36.750Z
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.
Sasho Nikolov
<pr.probability><ir.information-retrieval>
Why is the zero value ignored while deriving a ranking function for query terms in Probabilistic IR?
user1480133
# Why is the zero value ignored while deriving a ranking function for query terms in Probabilistic IR?

(Asked by: username_0 on 2013-09-05)

Take for instance [equation 67 and 68](https://i.sstatic.net/JKuOy.png) from this [chapter](http://nlp.stanford.edu/IR-book/html/htmledition/deriving-a-ranking-function-for-query-terms-1.html):

* 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?

**Tags:** pr.probability, ir.information-retrieval

> **Comments:**
> **username_1**: I'm not sure whether this question is on-topic here.  If it is not, it might be better-suited to [stats.se] or [CS.SE].  
> **username_2**: 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.  

---

## 1 answers

### Answer by username_1 on 2013-10-02. Score: 0

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](https://en.wikipedia.org/wiki/Additive_smoothing), add-one smoothing, Bayesian smoothing, or another similar method.


---

