|
|||||||||
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<IntDependency> |
argCounter
Stores all the counts for dependencies (with and without the word being a wildcard) in the reduced tag space. |
double |
interp
Interpolation between model that directly predicts aTW and model that predicts aT and then aW given aT. |
protected static double |
MIN_PROBABILITY
|
protected int |
numWordTokens
|
double |
smooth_aPTW_aPT
|
double |
smooth_aT_hTd
|
double |
smooth_aT_hTWd
Bayesian m-estimate prior for aT given hTWd against base distribution of aT given hTd. |
double |
smooth_aTW_aT
|
double |
smooth_aTW_hTd
|
double |
smooth_aTW_hTWd
Bayesian m-estimate prior for aTW given hTWd against base distribution of aTW given hTd. |
double |
smooth_stop
|
protected Counter<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(IntDependency dependency,
double count)
Add this dependency with the given count to the grammar. |
double |
countHistory(IntDependency dependency)
|
void |
dumpSizes()
|
protected void |
expandDependency(IntDependency dependency,
double count)
The dependency arg is still in the full tag space. |
protected double |
getStopProb(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(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. |
double |
scoreAll(Collection<IntDependency> deps)
|
double |
scoreTB(IntDependency dependency)
Score a tag binned dependency. |
String |
toString()
|
protected static edu.stanford.nlp.parser.lexparser.MLEDependencyGrammar.EndHead |
treeToDependencyHelper(Tree tree,
List<IntDependency> depList,
int loc)
Adds dependencies to list depList. |
static List<IntDependency> |
treeToDependencyList(Tree tree)
Returns the List of dependencies for a binarized Tree. |
void |
tune(Collection<Tree> trees)
Tune the smoothing and interpolation parameters of the dependency grammar based on a tuning treebank. |
void |
writeData(PrintWriter out)
Writes out data from this Object to the Writer w. |
Methods inherited from class edu.stanford.nlp.parser.lexparser.AbstractDependencyGrammar |
---|
coarseDistanceBin, distanceBin, initTagBins, 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 numWordTokens
protected Counter<IntDependency> argCounter
protected Counter<IntDependency> stopCounter
public double smooth_aT_hTWd
public double smooth_aTW_hTWd
public double smooth_stop
public double interp
public double smooth_aTW_aT
public double smooth_aTW_hTd
public double smooth_aT_hTd
public double smooth_aPTW_aPT
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<IntDependency> depList, int loc)
public void dumpSizes()
public static List<IntDependency> treeToDependencyList(Tree tree)
tree
- A tree to be analyzed as dependencies
public double scoreAll(Collection<IntDependency> deps)
public void tune(Collection<Tree> trees)
tune
in interface DependencyGrammar
tune
in class AbstractDependencyGrammar
trees
- A Collection of Trees for setting parameterspublic void addRule(IntDependency dependency, double count)
protected void expandDependency(IntDependency dependency, double count)
dependency
- An opbserved dependencycount
- The weight of the dependencypublic double countHistory(IntDependency dependency)
public double scoreTB(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(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(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 |