Wednesday, May 6, 2020

How to calculate the probability of a sentence in NLP using PCFG

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:
Page 1    Page 2    Page 3

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 t1

                    = 1.0 * 0.1 * 0.7 * 1.0 * 0.4 * 0.18 * 1.0 * 1.0 * 0.18
                   = 0.0009072

Probability of tree t2
P(t2) = 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 t1 is greater than the probability of parse tree t2. Hence, t1 is the more probable of the two parses.

Page 1    Page 2    Page 3
********************

Related links:

How to derive probabilities for production rules from Treebank using maximum likelihood estimate

PCFG probabilities estimation

How to calculated production rule probability in PCFG using tree banks

Probabilistic context free grammar rule probability estimation using tree banks

No comments:

Post a Comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery