Vous êtes sur la page 1sur 27

Evaluasi Parser dan

Dependency Parsing
Sumber:
Niranjan Balasubramanian slide,
http://www.phontron.com/slides/nlp-programming-en-11-depend.pdf,
http://www.cs.umd.edu/class/fall2017/cmsc723/slides/slides_12.pdf
Kerangka
● Evaluasi constituent-based parser
● Definisi dependency parsing
● Metode untuk membangun dependency parser
Evaluasi constituent-based parser




Evaluasi constituent-based parser (lanj.)


Evaluasi constituent-based parser (lanj.)
Metriks Evaluasi
Performansi Beberapa Parser constituent-based
Performansi Beberapa Parser constituent-based
(lanj.)
Dependency Parsing
● Dependency grammar
● Definisi formal
Dependency Grammar
Syntactic structure = lexical items linked by binary asymmetrical relations called
dependencies
Dependency Relations
Contoh dependency relations dalam kalimat
Contoh dependency parse sebuah kalimat
Definisi Formal dependency
Most general form: a graph G = (V,A)

● V vertices: usually one per word in sentence


● A arcs (set of ordered pairs of vertices): head-dependent relations between
elements in V

Restricting to trees provide computational advantages

● Single designated ROOT node that has no incoming arcs


● Except for ROOT, each vertex has exactly one incoming arc
● Unique path from ROOT to each vertex in V
Aturan dalam dependency
● Each word has a single head
● Dependency structure is connected
● There is a single root node from which there is a unique path to each word
Projectivity
Arc from head to dependent is projective

● If there is a path from head to every word between head and dependent

Dependency tree is projective

● If all arcs are projective


● Or equivalently, if it can be drawn with no crossing edges

Projective trees make computation easier

● But most theoretical frameworks do not assume projectivity


● Need to capture long-distance dependencies, free word order
Pendekatan dalam membangun dependency parser
● Goal: learn a good predictor of dependency graphs
● Input: sentence
● Output: dependency graph/tree G = (V,A)

approaches: spanning tree, transition-based parsing/shift-reduce, ...


Maximum Spanning Tree
● Each dependency is an edge in a directed graph
● Assign each edge a score (with machine learning)
● Keep the tree with the highest score
Transition-based/shift-reduce dependency parser
Builds on shift-reduce parsing [Aho & Ullman, 1927]

Configuration:

● Stack
● Input buffer of words
● Set of dependency relations

Goal of parsing: find a final configuration where all words accounted for relations
form dependency tree
Transition Operators
Arc Standard Transition System
Arc Standard Transition System
Preconditions

● ROOT cannot have incoming arcs


● LEFT-ARC cannot be applied when ROOT is the 2nd element in stack
● LEFT-ARC and RIGHT-ARC require 2 elements in stack to be applied
Transition-based dependency parser
● Assume an oracle
● Parsing complexity: Linear in sentence length!
● Greedy algorithm, unlike Viterbi for POS tagging
Ilustrasi transition-based parsing
Bagaimana memperoleh oracle?
Multiclass classification problem

● Input: current parsing state (e.g., current and previous configurations)


● Output: one transition among all possible transitions
● Q: size of output space?

Supervised classifiers can be used, e.g., perceptron

Diskusi:

● What are good features for this task?


● Where do we get training examples?
Classification for action
Membangun Data Latih

Treebank dataset:

Vous aimerez peut-être aussi