Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Nested Class Summary

Nested classes/interfaces inherited from class edu.stanford.nlp.trees.BobChrisTreeNormalizer
`BobChrisTreeNormalizer.AOverAFilter, BobChrisTreeNormalizer.EmptyFilter`

Field Summary
`static int` | `TEMPORAL_9`
`static int` | `TEMPORAL_ACL03PCFG`
`static int` | `TEMPORAL_ALL_NP`
`static int` | `TEMPORAL_ALL_NP_AND_PP`
`static int` | `TEMPORAL_ALL_NP_EVEN_UNDER_PP`
`static int` | `TEMPORAL_ALL_NP_PP_ADVP`
`static int` | `TEMPORAL_ALL_TERMINALS`
`static int` | `TEMPORAL_ANY_TMP_PERCOLATED`
`static int` | `TEMPORAL_NONE`
`static int` | `TEMPORAL_NP_AND_PP_WITH_NP_HEAD`

Fields inherited from class edu.stanford.nlp.trees.BobChrisTreeNormalizer
`aOverAFilter, emptyFilter, tlp`

Constructor Summary
`NPTmpRetainingTreeNormalizer()`
`NPTmpRetainingTreeNormalizer(int temporalAnnotation, boolean doSGappedStuff)`
`NPTmpRetainingTreeNormalizer(int temporalAnnotation, boolean doSGappedStuff, int leaveItAll, boolean doAdverbialNP)`
`NPTmpRetainingTreeNormalizer(int temporalAnnotation, boolean doSGappedStuff, int leaveItAll, boolean doAdverbialNP, HeadFinder headFinder)` Create a TreeNormalizer that maintains some functional annotations, particularly those involving temporal annotation.

Method Summary
`protected String` | `cleanUpLabel(String label)` Remove things like hyphened functional tags and equals from the end of a node label.
`Tree` | `normalizeWholeTree(Tree tree, TreeFactory tf)` Normalize a whole tree -- one can assume that this is the root.

Methods inherited from class edu.stanford.nlp.trees.BobChrisTreeNormalizer
`normalizeNonterminal, normalizeTerminal`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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

### TEMPORAL_9

    public static final int TEMPORAL_9

See Also:
  Constant Field Values

Constructor Detail

### NPTmpRetainingTreeNormalizer

    public NPTmpRetainingTreeNormalizer()

### NPTmpRetainingTreeNormalizer

    public NPTmpRetainingTreeNormalizer(int temporalAnnotation,
                                        boolean doSGappedStuff)

### NPTmpRetainingTreeNormalizer

    public NPTmpRetainingTreeNormalizer(int temporalAnnotation,
                                        boolean doSGappedStuff,
                                        int leaveItAll,
                                        boolean doAdverbialNP)

### NPTmpRetainingTreeNormalizer

    public NPTmpRetainingTreeNormalizer(int temporalAnnotation,
                                        boolean doSGappedStuff,
                                        int 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 those categories: annotation stops at either a POS tag (which is annotated) or a non-NP/PP/ADVP head (which isn't annotated)), TEMPORAL_9 (annotates like the previous one but does all NP inside node, and their children if pre-pre-terminal rather than only if head).
    `doSGappedStuff` - Leave -SBJ marking on subject NP and then mark S-G sentences with a gapped subject.
    `leaveItAll` - 0 means the usual stripping of functional tags and indices; 1 leaves all functional tags but still strips indices; 2 leaves everything
    `doAdverbialNP` - Leave -ADV functional tag on adverbial NPs and maybe add it to their head
    `headFinder` - A head finder that is used with some of the options for temporalAnnotation

Method Detail

### 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`
  Parameters:
    `label` - The label from the treebank
  Returns:
    The cleaned up label (phrase structure category)

### 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 normalized
    `tf` - the TreeFactory to create new nodes (if needed)
  Returns:
    Tree the normalized tree

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Stanford NLP Group