public abstract class ParsingSystem
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
labels |
protected java.lang.String |
rootLabel
Dependency label used between root of sentence and ROOT node.
|
protected java.util.List<java.lang.String> |
transitions |
Constructor and Description |
---|
ParsingSystem(TreebankLanguagePack tlp,
java.util.List<java.lang.String> labels,
java.util.List<java.lang.String> transitions,
boolean verbose) |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(Configuration c,
java.lang.String t)
Apply the given transition to the given configuration, modifying
the configuration's state in place.
|
abstract boolean |
canApply(Configuration c,
java.lang.String t)
Determine whether the given transition is legal for this
configuration.
|
java.util.Map<java.lang.String,java.lang.Double> |
evaluate(java.util.List<CoreMap> sentences,
java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> trees,
java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees)
Evaluate performance on a list of sentences, predicted parses,
and gold parses.
|
abstract java.lang.String |
getOracle(Configuration c,
edu.stanford.nlp.parser.nndep.DependencyTree dTree)
Provide a static-oracle recommendation for the next parsing step
to take.
|
int |
getTransitionID(java.lang.String s) |
double |
getUAS(java.util.List<CoreMap> sentences,
java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> trees,
java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees) |
double |
getUASnoPunc(java.util.List<CoreMap> sentences,
java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> trees,
java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees) |
abstract Configuration |
initialConfiguration(CoreMap sentence)
Build an initial parser configuration from the given sentence.
|
int |
numTransitions()
Return the number of transitions.
|
protected final java.lang.String rootLabel
protected final java.util.List<java.lang.String> labels
protected final java.util.List<java.lang.String> transitions
public ParsingSystem(TreebankLanguagePack tlp, java.util.List<java.lang.String> labels, java.util.List<java.lang.String> transitions, boolean verbose)
tlp
- TreebankLanguagePack describing the language being
parsedlabels
- A list of possible dependency relation labels, with
the ROOT relation label as the first elementpublic abstract boolean canApply(Configuration c, java.lang.String t)
c
- Parsing configurationt
- Transition stringpublic abstract void apply(Configuration c, java.lang.String t)
public abstract java.lang.String getOracle(Configuration c, edu.stanford.nlp.parser.nndep.DependencyTree dTree)
c
- Current parser configurationdTree
- Gold tree which parser needs to reachpublic abstract Configuration initialConfiguration(CoreMap sentence)
public int numTransitions()
public int getTransitionID(java.lang.String s)
public java.util.Map<java.lang.String,java.lang.Double> evaluate(java.util.List<CoreMap> sentences, java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> trees, java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees)
public double getUAS(java.util.List<CoreMap> sentences, java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> trees, java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees)
public double getUASnoPunc(java.util.List<CoreMap> sentences, java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> trees, java.util.List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees)