Contents
Inside–outside algorithm
For parsing algorithms in computer science, the inside–outside algorithm is a way of re-estimating production probabilities in a probabilistic context-free grammar. It was introduced by James K. Baker in 1979 as a generalization of the forward–backward algorithm for parameter estimation on hidden Markov models to stochastic context-free grammars. It is used to compute expectations, for example as part of the expectation–maximization algorithm (an unsupervised learning algorithm).
Inside and outside probabilities
The inside probability is the total probability of generating words, given the root nonterminal N^j and a grammar G: The outside probability is the total probability of beginning with the start symbol N^1 and generating the nonterminal N^j_{pq} and all the words outside, given a grammar G:
Computing inside probabilities
Base Case: General case: Suppose there is a rule in the grammar, then the probability of generating starting with a subtree rooted at N_j is: The inside probability is just the sum over all such possible rules:
Computing outside probabilities
Base Case: Here the start symbol is N_1. General case: Suppose there is a rule in the grammar that generates N_j. Then the left contribution of that rule to the outside probability is: Now suppose there is a rule in the grammar. Then the right contribution of that rule to the outside probability is: The outside probability is the sum of the left and right contributions over all such rules:
This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.
Wikipedia® is a registered trademark of the
Wikimedia Foundation, Inc.
Bliptext is not
affiliated with or endorsed by Wikipedia or the
Wikimedia Foundation.