In [2]:
%matplotlib inline
In [4]:
%load_ext autoreload
In [5]:
%autoreload 2
import sys
import scipy
sys.path.append(".")
import lxmls
The CKY algorithm is a dynamic programming algorithm, much like Viterbi. The general idea is to build up on smaller, simpler things you have computed in previous iterations.
Viterby is focused on building sequences (of labels) by computing the highest scoring sequence of length $n$ from sequences of length $(n-1)$. CKY expands this idea to graphs, which can be thought as higher dimension sequences. In particular, trees spanning over $n$ words are built from trees spanning up to $(n-1)$ words.
In the next section, we're going to do some CKY iterations on a real sequence, to get a more concrete sense of how the algorithm works.
In [ ]: