# Probabilistic Context Free Grammar How to calculate the probability of a sentence given the probabilities of various parse trees in PCFG

__Probability of a sentence:__
Probability of a
sentence is the sum of probabilities of all parse trees that can be derived
from the sentence under PCFG;

__Example:__

__Probability of tree t___{1}
= 1.0 * 0.1 * 0.7 * 1.0 * 0.4
* 0.18 * 1.0 * 1.0 * 0.18

= 0.0009072

__Probability of tree t___{2}
P(t

_{2}) = 1.0 * 0.1 * 0.3 * 0.7 * 1.0 * 0.18 * 1.0 * 1.0 * 0.18
=
0.0006804

__Probability of the sentence:__
Probability of the
sentence “astronomers saw the stars with ears”;

__Which is the most probable tree?__
The probability of
the parse tree t

_{1}is greater than the probability of parse tree t_{2}. Hence, t_{1}is the more probable of the two parses.************************

###
**Related links:**

**Related links:**

**Go to Natural Language Processing (NLP) home**

**Go to NLP Solved Exercise page**

**Go to Context Free Grammar (CFG) Formal Definition page****Go to How to derive production rule probability from Treebank using MLE - Solved exercise page**

## No comments:

## Post a comment