Defining lader features

<< lader home

One of the important elements to achieve good accuracy with lader is to define useful features for parsing and reordering. Once you understand the general idea of how the parser works (e.g. by reading the paper), the feature set for lader can be defined easily using feature templates. In general, you will want to define features over sequences of words or tags, but it is also possible to define features over parse trees if you have a parser available. Features are defined separately over each set of annotations in a format similar to the following:

seq=...|seq=...|seq=...|cfg=...

In this case, we have three sets of features over sequences, and one over cfgs. The number and type of features we define depends on the number of annotations we are using, as described in the example training script. How we fill in each of these annotation strings is different for sequence and CFG features, and I will explain more below.

Sequence Feature Functions

A single sequence feature set definition takes the following form, defining dictionaries and feature templates:

seq=[DICT0],[DICT1],...,[FEAT0],[FEAT1],[FEAT2],...

DICT0, DICT1, etc. are paths to scored dictionaries (phrase tables) that can be referenced by later features. Each entry takes the form "dict=/path/to/dictionary.txt". Dictionaries can be referenced either using the absolute path, or the relative path from the model file.

FEAT0, FEAT1, etc. are feature templates. A feature template takes the form "NAME%VAR1%VAR2%VAR3...". NAME is the name of the feature, which can be set arbitrarily. %VAR1, %VAR2, etc. are variable definitions that will be set based on the properties of a node of the parse tree. Below is a list of variable types that can be used and the values that they will take for the node in the picture below.

Now, an example of the actual features that we found to be useful in our experiments. Note that we intersected all features with the node type, so entirely different feature values were learned for straight and inverted non-terminals and terminals.

CFG Feature Functions

CFG feature functions are defined over a parse tree, and are quite simple compared to sequence features. They are defined over spans (like the word features above), and take the value of the constituent label in the parse tree for the span. If there is no constituent that corresponds to the span, they will take the value "X." Examples of the features used in the paper are below:

<< lader home