edu.stanford.nlp.trees
Class SemanticHeadFinder

java.lang.Object
  extended by edu.stanford.nlp.trees.AbstractCollinsHeadFinder
      extended by edu.stanford.nlp.trees.CollinsHeadFinder
          extended by edu.stanford.nlp.trees.ModCollinsHeadFinder
              extended by edu.stanford.nlp.trees.SemanticHeadFinder
All Implemented Interfaces:
HeadFinder, Serializable

public class SemanticHeadFinder
extends ModCollinsHeadFinder

Implements a 'semantic head' variant of the the HeadFinder found in Michael Collins' 1999 thesis. This version chooses the semantic head verb rather than the verb form for cases with verbs. And it makes similar themed changes to other categories: e.g., in question phrases, like "Which Brazilian game", the head is made "game" not "Which" as in common PTB head rules.

By default the SemanticHeadFinder uses a treatment of copula where the complement of the copula is taken as the head. That is, a sentence like "Bill is big" will be analyzed as

nsubj(big, Bill)
cop(big, is)

This analysis is used for questions and declaratives for adjective complements and declarative nominal complements. However Wh-sentences with nominal complements do not receive this treatment. "Who is the president?" is analyzed with "the president" as nsubj and "who" as "attr" of the copula:

nsubj(is, president)
attr(is, Who)

(Such nominal copula sentences are complex: arguably, depending on the circumstances, several analyses are possible, with either the overt NP able to be any of the subject, the predicate, or one of two referential entities connected by an equational copula. These uses aren't differentiated.)

Existential sentences are treated as follows:
"There is a man"
expl(is, There)
det(man-4, a-3)
nsubj(is-2, man-4)

Author:
John Rappaport, Marie-Catherine de Marneffe, Anna Rafferty
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.nlp.trees.AbstractCollinsHeadFinder
defaultRule, nonTerminalInfo, tlp
 
Constructor Summary
SemanticHeadFinder()
           
SemanticHeadFinder(boolean cop)
           
SemanticHeadFinder(TreebankLanguagePack tlp, boolean cop)
          Create a SemanticHeadFinder.
 
Method Summary
protected  Tree determineNonTrivialHead(Tree t, Tree parent)
          Determine which daughter of the current parse tree is the head.
 boolean isVerbalAuxiliary(Tree t)
          Reinserted so samples.GetSubcats compiles ...
protected  int postOperationFix(int headIdx, Tree[] daughterTrees)
          Overwrite the postOperationFix method: a, b and c -> we want a to be the head
 
Methods inherited from class edu.stanford.nlp.trees.CollinsHeadFinder
main
 
Methods inherited from class edu.stanford.nlp.trees.AbstractCollinsHeadFinder
determineHead, determineHead, findMarkedHead, traverseLocate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemanticHeadFinder

public SemanticHeadFinder()

SemanticHeadFinder

public SemanticHeadFinder(boolean cop)

SemanticHeadFinder

public SemanticHeadFinder(TreebankLanguagePack tlp,
                          boolean cop)
Create a SemanticHeadFinder.

Parameters:
tlp - The TreebankLanguagePack, used by the superclass to get basic category of constituents.
cop - If true, a copular verb (be, seem, appear, stay, remain, resemble, become) is not treated as head when it has an AdjP or NP complement. If false, a copula verb is still always treated as a head. But it will still be treated as an auxiliary in periphrastic tenses with a VP complement.
Method Detail

postOperationFix

protected int postOperationFix(int headIdx,
                               Tree[] daughterTrees)
Overwrite the postOperationFix method: a, b and c -> we want a to be the head

Overrides:
postOperationFix in class CollinsHeadFinder
Parameters:
headIdx - the index of the proposed head
daughterTrees - the array of daughter trees
Returns:
the new headIndex

determineNonTrivialHead

protected Tree determineNonTrivialHead(Tree t,
                                       Tree parent)
Determine which daughter of the current parse tree is the head. It assumes that the daughters already have had their heads determined. Uses special rule for VP heads

Overrides:
determineNonTrivialHead in class AbstractCollinsHeadFinder
Parameters:
t - The parse tree to examine the daughters of. This is assumed to never be a leaf
Returns:
The parse tree that is the head

isVerbalAuxiliary

public boolean isVerbalAuxiliary(Tree t)
Reinserted so samples.GetSubcats compiles ... should rework if this is going to stay.

Parameters:
t - A tree to examine for being an auxiliary.
Returns:
Whether it is a verbal auxiliary (be, do, have, get)


Stanford NLP Group