|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.parser.lexparser.TreeBinarizer
public class TreeBinarizer
Binarizes trees in such a way that head-argument structure is respected. Looks only at the value of input tree nodes. Produces LSTrees with CWT labels. The input trees have to have CWT labels! Although the binarizer always respects heads, you can get left or right binarization by defining an appropriate HeadFinder.
Constructor Summary | |
---|---|
TreeBinarizer(HeadFinder hf,
TreebankLanguagePack tlp,
boolean insideFactor,
boolean markovFactor,
int markovOrder,
boolean useWrappingLabels,
boolean unaryAtTop,
double selectiveSplitThreshold,
boolean markFinalStates)
Build a custom binarizer for Trees. |
Method Summary | |
---|---|
protected static boolean |
isSynthetic(String label)
|
static void |
main(String[] args)
Let's you test out the TreeBinarizer on the command line. |
void |
setDoSelectiveSplit(boolean doSelectiveSplit)
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. |
Tree |
transformTree(Tree t)
Binarizes the tree according to options set up in the constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeBinarizer(HeadFinder hf, TreebankLanguagePack tlp, boolean insideFactor, boolean markovFactor, int markovOrder, boolean useWrappingLabels, boolean unaryAtTop, double selectiveSplitThreshold, boolean markFinalStates)
hf
- the HeadFinder to use in binarizationtlp
- the TreebankLanguagePack to useinsideFactor
- whether to do inside markovizationmarkovFactor
- whether to markovize the binary rulesmarkovOrder
- the markov order to use; only relevant with markovFactor=trueuseWrappingLabels
- whether to use state names (labels) that allow wrapping from right to leftunaryAtTop
- 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 happeningselectiveSplitThreshold
- if selective split is used, this will be the threshold used to decide which state splits to keepmarkFinalStates
- whether or not to make the state names (labels) of the final active states distinctiveMethod Detail |
---|
public void setDoSelectiveSplit(boolean doSelectiveSplit)
doSelectiveSplit
- protected static boolean isSynthetic(String label)
public Tree transformTree(Tree t)
transformTree
in interface TreeTransformer
t
- A tree to be binarized. The non-leaf nodes must already have
CategoryWordTag labels, with heads percolated.
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |