Could anyone explain how does the maltparser convert the dependency trees from a CONLL file to a series of transitions in order to train its classifier ?
2 Answers
You can use a converter, such as the ClearNLP C2DConvert for this, which takes PTB trees (constituency parses) and converts to dependency parses in CLEAR style, or ConLL (TSV), format, which Malt and ClearNLP and other parsers use.
This will convert this:
((S (NP-SBJ (NP (NNP Pierre)
(NNP Vinken))
(, ,)
(ADJP (NML (CD 61)
(NNS years))
(JJ old))
(, ,))
(VP (MD will)
(VP (VB join)
(NP (DT the)
(NN board))
(PP-CLR (IN as)
(NP (DT a)
(JJ nonexecutive)
(NN director)))
(NP-TMP (NNP Nov.)
(CD 29))))
(. .)))
to this
1 Pierre pierre NNP _ 2 nn _
2 Vinken vinken NNP _ 9 nsubj _
3 , , , _ 2 punct _
4 61 0 CD _ 5 num _
5 years year NNS _ 6 npadvmod _
6 old old JJ _ 2 amod _
7 , , , _ 2 punct _
8 will will MD _ 9 aux _
9 join join VB _ 0 root _
10 the the DT _ 11 det _
11 board board NN _ 9 dobj _
12 as as IN syn=CLR 9 prep _
13 a a DT _ 15 det _
14 nonexecutive nonexecutive JJ _ 15 amod _
15 director director NN _ 12 pobj _
16 Nov. nov. NNP sem=TMP 9 npadvmod _
17 29 0 CD _ 16 num _
18 . . . _ 9 punct _
-
Thanks, but I want to code my own implementation of the maltparser. To train such a parser, I believe that I need to convert the training data to a series of correcy transitions (SHIFT, LEFT-ARC, RIGHT-ARC, REDUCE) in order for my oracle to learn the best transition given each configuration. Mar 29, 2016 at 12:08
You will need an oracle finding algorithm. Basically, given the gold standard dependency tree, the oracle finding algorithm tells you what is the next optimal action on a certain state. From the beginning state, you repeatedly apply the optimal action to your state and you can achieve the final state at last.
Different transition systems have different oracle finding algorithms. For the arc-standard system, see Figure 3 in Nivre (2008), Algorithms for deterministic incremental dependency parsing
: http://www.mitpressjournals.org/doi/pdf/10.1162/coli.07-056-R1-07-027. In this figure, the precondition rows actually say if your current state satisfy the condition, you can do LEFT-ARC, RIGHT-ARC, or SHIFT.
For the arc-eager system, see Figure 5 in the same paper.