edu.stanford.nlp.parser.lexparser
Class ExhaustiveDependencyParser

java.lang.Object
  extended by edu.stanford.nlp.parser.lexparser.ExhaustiveDependencyParser
All Implemented Interfaces:
Scorer

public class ExhaustiveDependencyParser
extends Object
implements Scorer

An exhaustive O(n3) dependency parser. Follows the general picture of the Eisner and Satta dependency parsing papers. As described in:

Dan Klein and Christopher D. Manning. 2003. Fast Exact Inference with a Factored Model for Natural Language Parsing. In Suzanna Becker, Sebastian Thrun, and Klaus Obermayer (eds), Advances in Neural Information Processing Systems 15 (NIPS 2002). Cambridge, MA: MIT Press, pp. 3-10. http://nlp.stanford.edu/pubs/lex-parser.pdf

[dramage: Need to change iScoreH to sum instead of max .. then iScore will return total probability of a given subtree as being under a particular head (versus max prob). ]

Author:
Dan Klein

Constructor Summary
ExhaustiveDependencyParser(DependencyGrammar dg, Lexicon lex, Options op)
           
 
Method Summary
 void displayHeadScores()
          This displays a headScore matrix, which will be valid after parsing a sentence.
 Tree getBestParse()
          Return the best dependency parse for a sentence.
 boolean hasParse()
           
 boolean iPossible(edu.stanford.nlp.parser.lexparser.Hook hook)
           
 double iScore(Edge edge)
           
 boolean oPossible(edu.stanford.nlp.parser.lexparser.Hook hook)
           
 double oScore(Edge edge)
           
 boolean parse(List sentence)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExhaustiveDependencyParser

public ExhaustiveDependencyParser(DependencyGrammar dg,
                                  Lexicon lex,
                                  Options op)
Method Detail

oScore

public double oScore(Edge edge)
Specified by:
oScore in interface Scorer

iScore

public double iScore(Edge edge)
Specified by:
iScore in interface Scorer

oPossible

public boolean oPossible(edu.stanford.nlp.parser.lexparser.Hook hook)
Specified by:
oPossible in interface Scorer

iPossible

public boolean iPossible(edu.stanford.nlp.parser.lexparser.Hook hook)
Specified by:
iPossible in interface Scorer

parse

public boolean parse(List sentence)
Specified by:
parse in interface Scorer

hasParse

public boolean hasParse()

displayHeadScores

public void displayHeadScores()
This displays a headScore matrix, which will be valid after parsing a sentence. Unclear yet whether this is valid/useful [cdm].


getBestParse

public Tree getBestParse()
Return the best dependency parse for a sentence. You must call parse() before a call to this method.

Returns:
The best dependency parse for a sentence or null. The returned tree will begin with a binary branching node, the left branch of which is the dependency tree proper, and the right side of which contains a boundary word .$. which heads the sentence.


Stanford NLP Group