# Probabilistic Parsing How can we choose the correct tree for a given sentence? Traditional approach: grammar rules hand-written by linguists - constraints added to limit unlikely parses for sentences - hand-written grammars are not robust: often fail to parse new sentences. Current approach: use probabilities - Probabilitistic CFG (PCFG) a CFG where each rule is augmented with a probability ![[pcfg.jpg]] Using PCFGs, the probability of a parse tree for a given sentence is then given by the product of the probabilities of all the grammar rules used in the sentence derivation. These probabilities can provide a criterion for disambiguation: - i.e. a ranking over possible parses for any sentence - we can choose the parse tree with the highest probability. ### Treebank PCFGs - Treebanks: instead of paying linguists to write a grammar, pay them to annotate real sentences with parse trees. - This way, we implicitly get a grammar (for CFG: read the rules off the trees) - And we get probabilities for those rules - We can use these probabilities to improve disambiguation and also speed up parsing. ### Estimating rule probabilities from a treebank An estimated probability of a rule can be obtained by maximum likelihood estimate: $ p(X \rightarrow \alpha)=\frac{C(X \rightarrow \alpha)}{C(X)} $ Here, numerator is the number of times the rule is used in the corpus, and denominator is the number of times the nonterminal X appears in the treebank. --- ## References 1. Chapter 12, Jurafsky & Martin, 3rd Edition