public class TreeBinarizer extends Object implements TreeTransformer
|Constructor and Description|
Build a custom binarizer for Trees.
|Modifier and Type||Method and Description|
Lets you test out the TreeBinarizer on the command line.
If this is set to true, then the binarizer will choose selectively whether or not to split states based on how many counts the states had in a previous run.
Builds a TreeBinarizer with all of the options set to simple values
Binarizes the tree according to options set up in the constructor.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TreeBinarizer(HeadFinder hf, TreebankLanguagePack tlp, boolean insideFactor, boolean markovFactor, int markovOrder, boolean useWrappingLabels, boolean unaryAtTop, double selectiveSplitThreshold, boolean markFinalStates, boolean simpleLabels, boolean noRebinarization)
hf- the HeadFinder to use in binarization
tlp- the TreebankLanguagePack to use
insideFactor- whether to do inside markovization
markovFactor- whether to markovize the binary rules
markovOrder- the markov order to use; only relevant with markovFactor=true
useWrappingLabels- whether to use state names (labels) that allow wrapping from right to left
unaryAtTop- Whether to actually materialize the unary that rewrites a passive state to the active rule at the top of an original local tree. This is used only when compaction is happening
selectiveSplitThreshold- if selective split is used, this will be the threshold used to decide which state splits to keep
markFinalStates- whether or not to make the state names (labels) of the final active states distinctive
noRebinarization- if true, a node which already has exactly two children is not altered
public void setDoSelectiveSplit(boolean doSelectiveSplit)
doSelectiveSplit- Record this value and reset internal counter if false
public static TreeBinarizer simpleTreeBinarizer(HeadFinder hf, TreebankLanguagePack tlp)
public static void main(String args)
args- Command line arguments: flags as above, as above followed by treebankPath
Stanford NLP Group