Relation to older versions:
MaltParser 0.22 uses libTimbl, part of TiMBL (Tilburg Memory-Based Learner), Version 5.1, and LIBSVM, Version 2.8, in order to learn parsing models from treebanks, and we gratefully acknowledge the use of these software packages. However, MaltParser 0.22 is a standalone application, so there is no need to install either TiMBL or LIBSVM separately.
> ./maltparser -f file
where file is the name of an option file, specifying all the parameters needed. From version 0.22 it is also possible to specify options using command line flags, which will override any settings included in the option file. (Although it is possible to run the program using only flags and no option file, it is usually more convenient to combine the two methods.) The option file and the flags are described in detail below. A list of all flags and options can be obtained by running MaltParser with the -h flag:
> ./maltparser -h
In addition, the option file may contain comment lines starting with "--". The following table lists all the available parameters with their permissible values. Default values are marked with "*". Parameters that lack a default value must be specified in the option file (if they are required by the particular configuration of modules invoked). An example option file can be found here.
In the following table, we describe the different options that can be specified in the option file. Options that have no default value must be specify. For each option we also give the flag that can be used for specifying the option directly in the command line (overriding any specifications in the option file).
|INFILE||-i||Input file||Filename||The input (for both learning and parsing) must be in the Malt-TAB format. During learning the four columns form, postag, head, deprel are required; during parsing only the first two (form, postag) are required. An example input file can be found here.|
|OUTFORMAT||-O||Output data format||TAB|
|VERBOSE||-v||Output to terminal||YES*|
|MAXSENTENCELENGTH||-z||Maximum number of tokens per sentence||Integer||Default = 512|
|MAXTOKENLENGTH||-y||Maximum number of characters per token||Integer||Default = 256|
|MAXTAGLENGTH||-w||Maximum number of characters per tag name||Integer||Default = 128|
|POSSET||-P||Part-of-speech tagset||Filename||The part-of-speech tagset must be specified in a text file with one tag per line (and no blank lines). An example file can be found here.|
|DEPSET||-D||Dependency type tagset||Filename||The dependency type tagset must be specified in a text file with one tag per line (and no blank lines). The first tag must be the tag assigned to root nodes. An example file can be found here.|
|MODE||-m||Mode (learning or parsing)||PARSE*||Parsing (using an induced model to parse new data)|
|LEARN||Learning (inducing a model from treebank data)|
(see description below)
|Nivre (2003, 2004)|
Covington (2001) (incremental)
|PARSEROPTIONS||-p||Parser options (algorithm specific)||-a [ES]||Arc order (NIVRE):|
NB: In flag, whitespace is replaced by underscore (e.g. "-a_E" instead of "-a E").
|-g [NP]||Graph condition (COVINGTON):|
|MAXFEATURES||-c||Maximum number of features of each type||Integer||Default = 30|
|FEATURES||-F||Feature model specification|
(see description below)
|Filename||Model specified in Filename.par|
NB: If no feature model specification can be loaded, a default specification equivalent to m3.par is used for parsing.
(see description below)
|Memory-based learning (TiMBL)|
Support vector machine (LIBSVM)
|LEARNEROPTIONS||-L||Parameter settings (learner specific)||String||TiMBL example: "-m M -k 5 -w 0 -d ID -L 3"
(see TiMBL Documentation)|
NB: In flag, whitespace is replaced by underscore (e.g. "-m_M_-k_5" instead of "-m M -k 5").
|LIBSVM example: "-t 0" (see LIBSVM Documentation)|
<fspec> ::= <feat>+ <feat> ::= <lfeat> | <nlfeat> <lfeat> ::= LEX \t <dstruc> \t <off> \t <suff> \n <nlfeat> ::= (POS|DEP) \t <dstruc> \t <off> \n <dstruc> ::= (STACK|INPUT|CONTEXT) <off> ::= <nnint> \t <int> \t <nnint> \t <int> \t <int> <suff> ::= <nnint> <int> ::= (...|-2|-1|0|1|2|...) <nnint> ::= (0|1|2|...)
As syntactic sugar, any
can be truncated if all remaining integer values are zero. An example feature specification can
be found here.
Each feature is specified on a single line, consisting of at least two tab-separated
columns. The first column defines the feature type to be lexical (LEX),
part-of-speech (POS), or dependency (DEP).
The second column identifies one of the main data structures in the
parser configuration, usually the stack (STACK) or the list of remaining input tokens (INPUT),
as the ``base address'' of the feature. (The third alternative, CONTEXT, is relevant only
together with Covington's algorithm in non-projective mode.)
The actual address is then specified by a series of
``offsets'' with respect to the base address as follows:
POS STACK 0 0 0 0 0 POS INPUT 1 0 0 0 0 POS INPUT 0 -1 0 0 0 DEP STACK 0 0 1 0 0 DEP STACK 0 0 0 -1 0The feature defined on the first line is simply the part-of-speech of the token on top of the stack (TOP). The second feature is the part-of-speech of the token immediately after the next input token in the input list (NEXT), while the third feature is the part-of-speech of the token immediately before NEXT in the original input string (which may not be present either in the INPUT list or the STACK anymore). The fourth feature is the dependency type of the head of TOP (zero steps down the stack, zero steps forward/backward in the input string, one step up to the head). The fifth and final feature is the dependency type of the leftmost dependent of TOP (zero steps down the stack, zero steps forward/backward in the input string, zero steps up through heads, one step down to the leftmost dependent). Using the syntactic sugar of truncating all remaining zeros, these five features can also be specified more succintly:
POS STACK POS INPUT 1 POS INPUT 0 -1 DEP STACK 0 0 1 DEP STACK 0 0 0 -1The only difference between lexical and non-lexical features is that the specification of lexical features may contain an eighth column specifying a suffix length n. By convention, if n = 0, the entire word form is included; otherwise only the n last characters are included in the feature value. Thus, the following specification defines a feature the value of which is the four-character suffix of the word form of the next left sibling of the rightmost dependent of the head of the token immediately below TOP.
LEX STACK 1 0 1 1 -1 4Finally, it is worth noting that if any of the offsets is undefined in a given configuration, the feature is automatically assigned a null value.
The following table shows three of the models provided with Version 0.1 of MaltParser (there called MBL2, MBL3 and MBL4 because MBL was the only learner type supported in that version). For each model we also give a link to the feature specification for that model.
Inductive dependency parsing requires a learning algorithm to induce a mapping
from parser histories, relative to a given feature model, to parser actions, relative
to a given parsing algorithm. MaltParser comes with two different learning
algorithms, each with a wide variety of parameters: