Note that h.S L and h.S R refer to spans that are subsequences of p. We recursively compute the score of h as Require: beam width B; Require: weight vector w; 1: Initialize P , the set of accepted spans; 2: Initialize Q, the queue of candidate spans; 3: repeat 4: span p ← argmax p∈Q U (p.S.T.A); Update P with p ; 6: Update Q with p and P ; 7: where U is the score of an action.
the score of an hypothesis is the sum of the score of the most recent action h.A and the scores of the top hypotheses of the context states.