public abstract class ParsingSystem extends Object
Modifier and Type | Field and Description |
---|---|
protected List<String> |
labels |
protected String |
rootLabel
Dependency label used between root of sentence and ROOT node
|
protected List<String> |
transitions |
Constructor and Description |
---|
ParsingSystem(TreebankLanguagePack tlp,
List<String> labels,
boolean verbose) |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(Configuration c,
String t)
Apply the given transition to the given configuration, modifying
the configuration's state in place.
|
abstract boolean |
canApply(Configuration c,
String t)
Determine whether the given transition is legal for this
configuration.
|
Map<String,Double> |
evaluate(List<CoreMap> sentences,
List<edu.stanford.nlp.parser.nndep.DependencyTree> trees,
List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees)
Evaluate performance on a list of sentences, predicted parses,
and gold parses.
|
abstract 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(String s) |
double |
getUASScore(List<CoreMap> sentences,
List<edu.stanford.nlp.parser.nndep.DependencyTree> trees,
List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees) |
abstract Configuration |
initialConfiguration(CoreMap sentence)
Build an initial parser configuration from the given sentence.
|
protected abstract void |
makeTransitions()
Generate all possible transitions which this parsing system can
take for any given configuration.
|
protected final String rootLabel
public ParsingSystem(TreebankLanguagePack tlp, List<String> labels, boolean verbose)
tlp
- TreebankLanguagePack describing the language being
parsedlabels
- A list of possible dependency relation labels, with
the ROOT relation label as the first elementprotected abstract void makeTransitions()
public abstract boolean canApply(Configuration c, String t)
c
- Parsing configurationt
- Transition stringpublic abstract void apply(Configuration c, String t)
public abstract 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 getTransitionID(String s)
public Map<String,Double> evaluate(List<CoreMap> sentences, List<edu.stanford.nlp.parser.nndep.DependencyTree> trees, List<edu.stanford.nlp.parser.nndep.DependencyTree> goldTrees)