edu.stanford.nlp.trees
Class SemanticHeadFinder
java.lang.Object
edu.stanford.nlp.trees.AbstractCollinsHeadFinder
edu.stanford.nlp.trees.CollinsHeadFinder
edu.stanford.nlp.trees.ModCollinsHeadFinder
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. Should remember auxiliaries to differentiate past
and passive, though.
By default the SemanticHeadFinder uses a treatment of copula, i.e., a sentence like
"Bill is big" will be analyzed as
nsubj
(big, Bill)
cop
(big, is)
However WH-sentences do not receive this treatment.
A lot of special rules would be needed to make a distinction between
"Which country is she in?" and "Which country is big?"
Moreoverthe parser often gets wrong sentences like "How much was the check?":
"How much" is tagged as a WHNP, which complicates the rules...
(We cannot rely on looking for a WHNP and then see the structure in the SQ).
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SemanticHeadFinder
public SemanticHeadFinder()
SemanticHeadFinder
public SemanticHeadFinder(boolean cop)
SemanticHeadFinder
public SemanticHeadFinder(TreebankLanguagePack tlp,
boolean cop)
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 headdaughterTrees
- 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 VPheads
- 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