|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.parser.lexparser.AbstractDependencyGrammar
edu.stanford.nlp.parser.lexparser.MLEDependencyGrammar
public class MLEDependencyGrammar
Field Summary | |
---|---|
protected Counter |
argCounter
|
double |
interp
|
protected static double |
MIN_PROBABILITY
|
protected int |
numWords
|
double |
smooth_aT_hTWd
|
double |
smooth_aTW_hTWd
|
double |
smooth_stop
|
protected Counter |
stopCounter
|
protected List<IntTaggedWord> |
tagITWList
|
Fields inherited from class edu.stanford.nlp.parser.lexparser.AbstractDependencyGrammar |
---|
directional, expandDependencyMap, numTagBins, stopTW, tagBin, tagProjection, tlp, useCoarseDistance, useDistance, wildTW |
Constructor Summary | |
---|---|
MLEDependencyGrammar(edu.stanford.nlp.parser.lexparser.TagProjection tagProjection,
TreebankLangParserParams tlpParams,
boolean directional,
boolean useDistance,
boolean useCoarseDistance)
|
|
MLEDependencyGrammar(TreebankLangParserParams tlpParams,
boolean directional,
boolean distance,
boolean coarseDistance)
|
Method Summary | |
---|---|
void |
addRule(edu.stanford.nlp.parser.lexparser.Dependency dependency,
double count)
Add this dependency with the given count to the grammar. |
double |
countHistory(edu.stanford.nlp.parser.lexparser.Dependency dependency)
|
void |
dumpSizes()
|
protected void |
expandDependency(edu.stanford.nlp.parser.lexparser.Dependency dependency,
double count)
|
protected double |
getStopProb(edu.stanford.nlp.parser.lexparser.Dependency dependency)
Return the probability (as a real number between 0 and 1) of stopping rather than generating another argument at this position. |
protected double |
probTB(edu.stanford.nlp.parser.lexparser.Dependency dependency)
Calculate the probability of a dependency as a real probability between 0 and 1 inclusive. |
boolean |
pruneTW(IntTaggedWord argTW)
|
void |
readData(BufferedReader in)
Populates data in this DependencyGrammar from the character stream given by the Reader r. |
protected double |
scoreAll(Collection deps)
|
double |
scoreTB(edu.stanford.nlp.parser.lexparser.Dependency dependency)
Score a Dependency according to the grammar. |
String |
toString()
|
protected static edu.stanford.nlp.parser.lexparser.MLEDependencyGrammar.EndHead |
treeToDependencyHelper(Tree tree,
List<edu.stanford.nlp.parser.lexparser.Dependency> depList,
int loc)
Adds dependencies to list depList. |
static List<edu.stanford.nlp.parser.lexparser.Dependency> |
treeToDependencyList(Tree tree)
Returns the List of dependencies for a Tree. |
void |
tune(Collection<Tree> trees)
Default is no-op. |
void |
writeData(PrintWriter out)
Writes out data from this Object to the Writer w. |
Methods inherited from class edu.stanford.nlp.parser.lexparser.AbstractDependencyGrammar |
---|
courseDistanceBin, distanceBin, intern, numDistBins, numTagBins, regDistanceBin, rootTW, score, score, scoreTB, tagBin, tagNumberer, valenceBin, wordNumberer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int numWords
protected Counter argCounter
protected Counter stopCounter
public double smooth_aT_hTWd
public double smooth_aTW_hTWd
public double smooth_stop
public double interp
protected transient List<IntTaggedWord> tagITWList
protected static final double MIN_PROBABILITY
Constructor Detail |
---|
public MLEDependencyGrammar(TreebankLangParserParams tlpParams, boolean directional, boolean distance, boolean coarseDistance)
public MLEDependencyGrammar(edu.stanford.nlp.parser.lexparser.TagProjection tagProjection, TreebankLangParserParams tlpParams, boolean directional, boolean useDistance, boolean useCoarseDistance)
Method Detail |
---|
public String toString()
toString
in class Object
public boolean pruneTW(IntTaggedWord argTW)
protected static edu.stanford.nlp.parser.lexparser.MLEDependencyGrammar.EndHead treeToDependencyHelper(Tree tree, List<edu.stanford.nlp.parser.lexparser.Dependency> depList, int loc)
public void dumpSizes()
public static List<edu.stanford.nlp.parser.lexparser.Dependency> treeToDependencyList(Tree tree)
protected double scoreAll(Collection deps)
public void tune(Collection<Tree> trees)
AbstractDependencyGrammar
tune
in interface DependencyGrammar
tune
in class AbstractDependencyGrammar
public void addRule(edu.stanford.nlp.parser.lexparser.Dependency dependency, double count)
protected void expandDependency(edu.stanford.nlp.parser.lexparser.Dependency dependency, double count)
public double countHistory(edu.stanford.nlp.parser.lexparser.Dependency dependency)
public double scoreTB(edu.stanford.nlp.parser.lexparser.Dependency dependency)
DependencyGrammar
dependency
- The dependency object to be scored, where the tags in
the dependency have already been mapped to a reduced space by a
tagProjection function.
protected double probTB(edu.stanford.nlp.parser.lexparser.Dependency dependency)
dependency
- The dependency for which the probability is to be
calculated. The tags in this dependency are in the reduced
TagProjection space.
protected double getStopProb(edu.stanford.nlp.parser.lexparser.Dependency dependency)
dependency
- The dependency used as the basis for stopping on.
Tags are assumed in the TagProjection spacepublic void readData(BufferedReader in) throws IOException
readData
in interface DependencyGrammar
readData
in class AbstractDependencyGrammar
IOException
public void writeData(PrintWriter out) throws IOException
writeData
in interface DependencyGrammar
writeData
in class AbstractDependencyGrammar
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |