|
|||||||||
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<edu.stanford.nlp.parser.lexparser.IntDependency> |
argCounter
|
double |
interp
|
protected static double |
MIN_PROBABILITY
|
protected int |
numWords
|
double |
smooth_aT_hTWd
|
double |
smooth_aTW_hTWd
|
double |
smooth_stop
|
protected Counter<edu.stanford.nlp.parser.lexparser.IntDependency> |
stopCounter
|
protected List<IntTaggedWord> |
tagITWList
The indices of this list are in the tag binned space. |
Fields inherited from class edu.stanford.nlp.parser.lexparser.AbstractDependencyGrammar |
---|
directional, expandDependencyMap, numTagBins, stopTW, tagBin, tagProjection, tlp, useCoarseDistance, useDistance, wildTW |
Constructor Summary | |
---|---|
MLEDependencyGrammar(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.IntDependency dependency,
double count)
Add this dependency with the given count to the grammar. |
double |
countHistory(edu.stanford.nlp.parser.lexparser.IntDependency dependency)
|
void |
dumpSizes()
|
protected void |
expandDependency(edu.stanford.nlp.parser.lexparser.IntDependency dependency,
double count)
The dependency arg is still in the full tag space. |
protected double |
getStopProb(edu.stanford.nlp.parser.lexparser.IntDependency 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.IntDependency 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<edu.stanford.nlp.parser.lexparser.IntDependency> deps)
|
double |
scoreTB(edu.stanford.nlp.parser.lexparser.IntDependency dependency)
Score a tag binned dependency. |
String |
toString()
|
protected static edu.stanford.nlp.parser.lexparser.MLEDependencyGrammar.EndHead |
treeToDependencyHelper(Tree tree,
List<edu.stanford.nlp.parser.lexparser.IntDependency> depList,
int loc)
Adds dependencies to list depList. |
static List<edu.stanford.nlp.parser.lexparser.IntDependency> |
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<edu.stanford.nlp.parser.lexparser.IntDependency> argCounter
protected Counter<edu.stanford.nlp.parser.lexparser.IntDependency> 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(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.IntDependency> depList, int loc)
public void dumpSizes()
public static List<edu.stanford.nlp.parser.lexparser.IntDependency> treeToDependencyList(Tree tree)
protected double scoreAll(Collection<edu.stanford.nlp.parser.lexparser.IntDependency> deps)
public void tune(Collection<Tree> trees)
AbstractDependencyGrammar
tune
in interface DependencyGrammar
tune
in class AbstractDependencyGrammar
public void addRule(edu.stanford.nlp.parser.lexparser.IntDependency dependency, double count)
protected void expandDependency(edu.stanford.nlp.parser.lexparser.IntDependency dependency, double count)
public double countHistory(edu.stanford.nlp.parser.lexparser.IntDependency dependency)
public double scoreTB(edu.stanford.nlp.parser.lexparser.IntDependency dependency)
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.IntDependency 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.IntDependency dependency)
dependency
- The dependency used as the basis for stopping on.
Tags are assumed to be in the TagProjection space.public 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 |