edu.stanford.nlp.trees
Class NPTmpRetainingTreeNormalizer
java.lang.Object
edu.stanford.nlp.trees.TreeNormalizer
edu.stanford.nlp.trees.BobChrisTreeNormalizer
edu.stanford.nlp.trees.NPTmpRetainingTreeNormalizer
- All Implemented Interfaces:
- Serializable
public class NPTmpRetainingTreeNormalizer
- extends BobChrisTreeNormalizer
Same TreeNormalizer as BobChrisTreeNormalizer, but optionally provides
four extras. I.e., the class name is now a misnomer.
1) retains -TMP labels on NP with the new identification NP-TMP,
and provides various options to percolate that option downwards
to the head noun, and perhaps also to inherit this from a PP-TMP.
2) Annotates S nodes which contain a gapped subject: i.e.,
S < (/^NP-SBJ/ < -NONE-) --> S-G
3) Leave all functional tags on nodes.
4) Keeps -ADV labels on NP and marks head tag with &`^ADV
Performance note: At one point in time, PCFG labeled F1 results
for the various TEMPORAL options in lexparser were:
0=86.7, 1=87.49, 2=86.87, 3=87.49, 4=87.48, 5=87.5, 6=87.07.
So, mainly avoid values of 0, 2, and 6.
At another point they were:
0=86.53, 1=87.1, 2=87.14, 3=87.22, 4=87.1, 5=87.13, 6=86.95, 7=87.16
- Author:
- Christopher Manning, Dan Klein
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEMPORAL_NONE
public static final int TEMPORAL_NONE
- See Also:
- Constant Field Values
TEMPORAL_ACL03PCFG
public static final int TEMPORAL_ACL03PCFG
- See Also:
- Constant Field Values
TEMPORAL_ANY_TMP_PERCOLATED
public static final int TEMPORAL_ANY_TMP_PERCOLATED
- See Also:
- Constant Field Values
TEMPORAL_ALL_TERMINALS
public static final int TEMPORAL_ALL_TERMINALS
- See Also:
- Constant Field Values
TEMPORAL_ALL_NP
public static final int TEMPORAL_ALL_NP
- See Also:
- Constant Field Values
TEMPORAL_ALL_NP_AND_PP
public static final int TEMPORAL_ALL_NP_AND_PP
- See Also:
- Constant Field Values
TEMPORAL_NP_AND_PP_WITH_NP_HEAD
public static final int TEMPORAL_NP_AND_PP_WITH_NP_HEAD
- See Also:
- Constant Field Values
TEMPORAL_ALL_NP_EVEN_UNDER_PP
public static final int TEMPORAL_ALL_NP_EVEN_UNDER_PP
- See Also:
- Constant Field Values
TEMPORAL_ALL_NP_PP_ADVP
public static final int TEMPORAL_ALL_NP_PP_ADVP
- See Also:
- Constant Field Values
NPTmpRetainingTreeNormalizer
public NPTmpRetainingTreeNormalizer()
NPTmpRetainingTreeNormalizer
public NPTmpRetainingTreeNormalizer(int temporalAnnotation,
boolean doSGappedStuff)
NPTmpRetainingTreeNormalizer
public NPTmpRetainingTreeNormalizer(int temporalAnnotation,
boolean doSGappedStuff,
boolean leaveItAll,
boolean doAdverbialNP)
NPTmpRetainingTreeNormalizer
public NPTmpRetainingTreeNormalizer(int temporalAnnotation,
boolean doSGappedStuff,
boolean leaveItAll,
boolean doAdverbialNP,
HeadFinder headFinder)
- Create a TreeNormalizer that maintains some functional annotations,
particularly those involving temporal annotation.
- Parameters:
temporalAnnotation
- One of the constants:
TEMPORAL_NONE (no temporal annotation kept on trees),
TEMPORAL_ACL03PCFG (temporal annotation on NPs, and percolated down
to head of constituent until and including POS tag),
TEMPORAL_ANY_TMP_PERCOLATED (temporal annotation on any phrase is
kept and percolated via head chain to and including POS tag),
TEMPORAL_ALL_TERMINALS (temporal annotation is kept on NPs, and
is placed on all POS tag daughters of that NP (but is not
percolated down a head chain through phrasal categories),
TEMPORAL_ALL_NP (temporal annotation on NPs, and it is percolated
down via the head chain, but only through NPs: annotation stops
at either a POS tag (which is annotated) or a non-NP head
(which isn't annotated)),
TEMPORAL_ALL_NP_AND_PP (keeps temporal annotation on NPs and PPs,
and it is percolated down via the head chain, but only through
NPs: annotation stops at either a POS tag (which is annotated)
or a non-NP head (which isn't annotated)).
TEMPORAL_NP_AND_PP_WITH_NP_HEAD (like TEMPORAL_ALL_NP_AND_PP
except an NP is regarded as the head of a PP)
TEMPORAL_ALL_NP_EVEN_UNDER_PP (like TEMPORAL_ALL_NP, but a PP-TMP
annotation above an NP is 'passed down' to annotate that NP
as temporal (but the PP itself isn't marked))
TEMPORAL_ALL_NP_PP_ADVP (keeps temporal annotation on NPs, PPs, and
ADVPs
and it is percolated down via the head chain, but only through
NPs: annotation stops at either a POS tag (which is annotated)
or a non-NP head (which isn't annotated)).headFinder
- A head finder that is used with some of the
options for temporalAnnotation
cleanUpLabel
protected String cleanUpLabel(String label)
- Remove things like hyphened functional tags and equals from the
end of a node label.
- Overrides:
cleanUpLabel
in class BobChrisTreeNormalizer
normalizeWholeTree
public Tree normalizeWholeTree(Tree tree,
TreeFactory tf)
- Normalize a whole tree -- one can assume that this is the root.
This implementation deletes empty elements (ones with nonterminal
tag label '-NONE-') from the tree.
- Overrides:
normalizeWholeTree
in class BobChrisTreeNormalizer
- Parameters:
tree
- The tree to be normalizedtf
- the TreeFactory to create new nodes (if needed)
- Returns:
- Tree the normalized tree
Stanford NLP Group