Advanced Database Management System - Tutorials and Notes: How to calculate the probability of a parse tree in PCFG

# Probabilistic Context Free Grammar How to calculate the probability of a parse tree

### Probability of a parse tree:

We have formally defined PCFG. Now the next question is how to use PCFG to derive the probability of a parse tree (derivation tree). As discussed, a sentence can be parsed into more than one way. That means, we can have more than one parse trees for the sentence as per the CFG due to ambiguity.
Given a parse tree t, with the production rules α1 → β1, α2 → β2, … , αn → βn from R (ie., αi → βi R), we can find the probability of tree t using PCFG as follows;

As per the equation, the probability P(t) of parse tree is the product of probabilities of production rules in the tree t.

Example:
Find the probability of the parse tree t given below;
= 1.0 * 0.1 * 0.7 * 1.0 * 0.4 * 0.18 * 1.0 * 1.0 * 0.18
= 0.0009072
The probability of the parse tree t is calculated as 0.0009072.

********************

• Go to NLP Solved Exercise page