Graph-Based Parsing Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Graph-Based Parsing 1(10)
1. Graph-Based Models 2. Projective Parsing 3. Non-Projective Parsing Graph-Based Parsing 2(10)
Graph-Based Models � Score ( x , y ) = Score ( i , l , j , x ) ( i , l , j ) ∈ A y � Score ( x , y ) = Score ( i , j , x ) ( i , j ) ∈ A y � Score ( x , y ) = Score ( h , d ) ( h , d ) ∈ A y Graph-Based Parsing 3(10)
Graph-Based Models � � Score ( x , y ) = Score 1 ( h , d ) + Score 2 ( h , s , d ) ( h , d ) ∈ A y ( h , s , d ) ∈ A y K 1 K 2 � � � � Score ( x , y ) = f k ( h , d ) · w k + f k ( h , s , d ) · w k k = 1 k = 1 ( h , d ) ∈ A y ( h , s , d ) ∈ A y Graph-Based Parsing 4(10)
Graph-Based Models PU OBJ PRED DET PC SBJ IOBJ ROOT She sent him a message by email . Score ( x , y ) = Score 1 ( root , sent ) + Score 1 ( sent , She ) + Score 1 ( sent , him ) + Score 1 ( sent , message ) + Score 1 ( sent , by ) + Score 1 ( sent , . ) + Score 1 ( message , a ) + Score 1 ( by , email ) + Score 2 ( root , − , sent ) + Score 2 ( sent , − , She ) + Score 2 ( sent , − , him ) + Score 2 ( sent , him , message ) + Score 2 ( sent , message , by ) + Score 2 ( sent , by , . ) + Score 2 ( message , − , by ) + Score 2 ( by , − , email ) Graph-Based Parsing 5(10)
Graph-Based Models Second-Order x h -pos, x s -pos, x d -pos x s -pos, x d -pos x s -word, x d -word x s -word, x d -pos x s -pos, x d -word Graph-Based Parsing 6(10)
Graph-Based Models First-Order Arc d h h d Second-Order Sibling Grand-Child d h g g h d d s h h s d g d h h d g Third-Order Tri-Sibling Grand-Sibling d s h g g h s d d t s h h s t d g d s h h s d g Graph-Based Parsing 7(10)
Projective Parsing Incomplete: C [ i ][ j ][ → ][ 0 ] C [ i ][ j ][ ← ][ 0 ] Complete: C [ i ][ j ][ → ][ 1 ] C [ i ][ j ][ ← ][ 1 ] Sibling: C [ i ][ j ][ − ][ 2 ] Graph-Based Parsing 8(10)
Projective Parsing 1 for i : 0 .. n and all d , c 2 C [ i ][ i ][ d ][ c ] ← 0 . 0 3 for m : 1 .. n 4 for i : 0 .. n − m 5 j ← i + m 6 C [ i ][ j ][ − ][ 2 ] ← max i ≤ k < j C [ i ][ k ][ → ][ 1 ] + C [ k + 1 ][ j ][ ← ][ 1 ] 7 C [ i ][ j ][ ← ][ 0 ] ← C [ i ][ j − 1 ][ → ][ 1 ] + C [ j ][ j ][ ← ][ 1 ] + Score ( j , − , i ) 8 C [ i ][ j ][ → ][ 0 ] ← C [ i ][ i ][ → ][ 1 ] + C [ i + 1 ][ j ][ ← ][ 1 ] + Score ( i , − , j ) 9 C [ i ][ j ][ ← ][ 0 ] ← max { C [ i ][ j ][ ← ][ 0 ] , max i ≤ k < j C [ i ][ k ][ − ][ 2 ] + C [ k ][ j ][ ← ][ 0 ] + Score ( j , k , i ) } 10 C [ i ][ j ][ → ][ 0 ] ← max { C [ i ][ j ][ → ][ 0 ] , max i < k ≤ j C [ i ][ k ][ → ][ 0 ] + C [ k ][ j ][ − ][ 2 ] + Score ( i , k , j ) } 11 C [ i ][ j ][ ← ][ 1 ] ← max i ≤ k < j C [ i ][ k ][ ← ][ 1 ] + C [ k ][ j ][ ← ][ 0 ] 12 C [ i ][ j ][ → ][ 1 ] ← max i < k ≤ j C [ i ][ k ][ → ][ 0 ] + C [ k ][ j ][ → ][ 1 ] 13 return C [ 0 ][ n ][ → ][ 1 ] Graph-Based Parsing 9(10)
Non-Projective Parsing y ∗ , z ∗ = Score 1 ( x , y ) + Score 2 ( x , z ) argmax y ∈ GEN ( x ) , z ∈ DG ( x ) , y = z Graph-Based Parsing 10(10)
Recommend
More recommend