|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.Item
danbikel.parser.CKYItem
danbikel.parser.CKYItem.MappedPrevModBaseNPAware
danbikel.parser.EMItem
public class EMItem
Class to represent a chart item when performing the Inside-Outside algorithm.
Nested Class Summary | |
---|---|
static class |
EMItem.AntecedentPair
Holds references to the one or two antecedents that yielded a particular consequent, along with the one or more events that generated the consequent. |
Nested classes/interfaces inherited from class danbikel.parser.CKYItem |
---|
CKYItem.BaseNPAware, CKYItem.KBestHack, CKYItem.MappedPrevModBaseNPAware, CKYItem.PrevModIsStart |
Field Summary | |
---|---|
protected EMItem.AntecedentPair |
antecedentPairs
A list of antecedent pairs for this item. |
protected int |
unaryLevel
The unary production level for this item. |
Fields inherited from class danbikel.parser.CKYItem |
---|
baseNPsCannotContainVerbs, constraint, containsVerb, containsVerbFalse, containsVerbTrue, containsVerbUndefined, end, garbage, headChild, headWord, label, leftChildren, leftPrevMods, leftSubcat, leftVerb, logPrior, logTreeProb, nonTreebankDelimiter, nonTreebankLeftBracket, nonTreebankRightBracket, numParses, numPrevMods, numPrevWords, outputInsideProbs, outputLexLabels, rightChildren, rightPrevMods, rightSubcat, rightVerb, start, stop, stopWord, topSym |
Fields inherited from class danbikel.parser.Item |
---|
logProb |
Constructor Summary | |
---|---|
EMItem()
Constructs a new EM (Inside-Outside) chart item, with all data members set to default values. |
Method Summary | |
---|---|
EMItem.AntecedentPair |
antecedentPairs()
Gets the antecedent pairs for this item. |
Item |
clear()
Clears all chart-related data in this item (most of the data members do not need to be cleared, as they are expressly set by the decoder). |
boolean |
equals(Object obj)
Returns whether this item is equal to the specified object, which must also be an instance of EMItem . |
void |
increaseInsideProb(double amount)
Increases the inside probability of the derivations represented by this item by the specified amount. |
void |
increaseOutsideProb(double amount)
Increases the outside probability of this item by the specified amount. |
double |
insideProb()
Gets the total inside probability of the derivations represented by this item. |
double |
logPrior()
Throws an UnsupportedOperationException . |
double |
logProb()
Throws an UnsupportedOperationException . |
double |
logTreeProb()
Throws an UnsupportedOperationException . |
double |
outsideProb()
Gets the outside probability of this item. |
void |
set(Symbol label,
Word headWord,
Subcat leftSubcat,
Subcat rightSubcat,
CKYItem headChild,
SLNode leftChildren,
SLNode rightChildren,
SexpList leftPrevMods,
SexpList rightPrevMods,
int start,
int end,
boolean leftVerb,
boolean rightVerb,
boolean stop,
double logTreeProb,
double logPrior,
double logProb)
This method simply throws an UnsupportedOperationException, as the log probabilities of the superclass are not used by this class. |
void |
set(Symbol label,
Word headWord,
Subcat leftSubcat,
Subcat rightSubcat,
CKYItem headChild,
SLNode leftChildren,
SLNode rightChildren,
SexpList leftPrevMods,
SexpList rightPrevMods,
int start,
int end,
boolean leftVerb,
boolean rightVerb,
boolean stop,
int unaryLevel,
double insideProb)
Sets all the data for this EM chart item. |
void |
setAntecedentPairs(EMItem.AntecedentPair pair)
Sets the antecedent pairs for this item. |
CKYItem |
setDataFrom(CKYItem other)
Sets all the data in this item from the specified item. |
void |
setInsideProb(double insideProb)
Sets the total inside probability of the derivations represented by this item. |
void |
setLogPrior(double logPrior)
Throws an UnsupportedOperationException . |
void |
setLogProb(double logProb)
Throws an UnsupportedOperationException . |
void |
setLogTreeProb(double logTreeProb)
Throws an UnsupportedOperationException . |
void |
setOutsideProb(double outsideProb)
Sets the outside probability of this item |
void |
setUnaryLevel(int unaryLevel)
Sets the unary productions level of this item. |
String |
toString()
Returns a human-readable string representation of the information in this item. |
int |
unaryLevel()
Gets the unary production level of this item. |
Methods inherited from class danbikel.parser.CKYItem.MappedPrevModBaseNPAware |
---|
hashCode, mappedPrevModsEqual |
Methods inherited from class danbikel.parser.CKYItem |
---|
children, containsVerb, containsVerbRecursive, edgeIndex, end, garbage, getConstraint, getLabel, hasAntecedent, hasEquivalentItem, headChild, headLabel, headWord, headWordIdx, isPreterminal, label, leftChildren, leftPrevMods, leftSubcat, leftVerb, numLeftChildren, numParses, numRightChildren, prevMods, prevWordsEqual, prevWordsEqual, rightChildren, rightPrevMods, rightSubcat, rightVerb, setChildren, setConstraint, setEdgeIndex, setGarbage, setLabel, setLeftSubcat, setPrevMods, setRightSubcat, setSideInfo, setSubcat, setVerb, shortBool, shortContainsVerb, start, stop, subcat, toSexp, toSexpInternal, verb |
Methods inherited from class danbikel.parser.Item |
---|
compareTo |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected EMItem.AntecedentPair antecedentPairs
protected int unaryLevel
Decoder.addUnaries(CKYItem, java.util.List)
Constructor Detail |
---|
public EMItem()
set(Symbol, Word, Subcat, Subcat, CKYItem, SLNode, SLNode, SexpList, SexpList, int, int, boolean, boolean, boolean, int, double)
Method Detail |
---|
public void set(Symbol label, Word headWord, Subcat leftSubcat, Subcat rightSubcat, CKYItem headChild, SLNode leftChildren, SLNode rightChildren, SexpList leftPrevMods, SexpList rightPrevMods, int start, int end, boolean leftVerb, boolean rightVerb, boolean stop, double logTreeProb, double logPrior, double logProb)
set
in class CKYItem
label
- the unlexicalized root label of this chart itemheadWord
- the head word of this chart itemleftSubcat
- the subcat on the left side of this item's head childrightSubcat
- the subcat on the right side of this item's head
childheadChild
- the head child item of this chart itemleftChildren
- the modifiers on the left side of this item's head
childrightChildren
- the modifiers on the right side of this item's head
childleftPrevMods
- a list of the previous modifiers on the left side of
this item's head childrightPrevMods
- a list of the previous modifiers on the right side of
this item's head childstart
- the index of the first word spanned by this itemend
- the index of the last word spanned by this itemleftVerb
- whether a verb has been generated anywhere in the
surface string of the modifiers on the left side of
this item's head childrightVerb
- whether a verb has been generated anywhere in the
surface string of the modifiers on the right side of
this item's head childstop
- whether this item has received its stop probabilitieslogTreeProb
- the log of the probability of generating all of this
item's child items (head child and left and right
modifier children)logPrior
- the log of the marginal probability of this item's
lexicalized root labellogProb
- the log of the probability of this chart item (its
score)public void set(Symbol label, Word headWord, Subcat leftSubcat, Subcat rightSubcat, CKYItem headChild, SLNode leftChildren, SLNode rightChildren, SexpList leftPrevMods, SexpList rightPrevMods, int start, int end, boolean leftVerb, boolean rightVerb, boolean stop, int unaryLevel, double insideProb)
label
- the unlexicalized root label of this chart itemheadWord
- the head word of this chart itemleftSubcat
- the subcat on the left side of this item's head childrightSubcat
- the subcat on the right side of this item's head
childheadChild
- the head child item of this chart itemleftChildren
- the modifiers on the left side of this item's head
childrightChildren
- the modifiers on the right side of this item's head
childleftPrevMods
- a list of the previous modifiers on the left side of
this item's head childrightPrevMods
- a list of the previous modifiers on the right side of
this item's head childstart
- the index of the first word spanned by this itemend
- the index of the last word spanned by this itemleftVerb
- whether a verb has been generated anywhere in the
surface string of the modifiers on the left side of
this item's head childrightVerb
- whether a verb has been generated anywhere in the
surface string of the modifiers on the right side of
this item's head childstop
- whether this item has received its stop probabilitiesunaryLevel
- the unary production level of this iteminsideProb
- the total inside probability of the derivations
represented by this itempublic CKYItem setDataFrom(CKYItem other)
setDataFrom
in class CKYItem
other
- the item whose data is to be transfered to this item.
public double logProb()
UnsupportedOperationException
.
logProb
in class CKYItem
CKYItem.logTreeProb()
,
CKYItem.logPrior()
public void setLogProb(double logProb)
UnsupportedOperationException
.
setLogProb
in class CKYItem
logProb
- the log of the probability of this chart item (its
score)CKYItem.logProb()
public double logPrior()
UnsupportedOperationException
.
logPrior
in class CKYItem
CKYItem.logProb()
,
CKYItem.logTreeProb()
public void setLogPrior(double logPrior)
UnsupportedOperationException
.
setLogPrior
in class CKYItem
logPrior
- the log of the marginal probability of the lexicalized root
nonterminal label of this chart itemCKYItem.logPrior()
public double logTreeProb()
UnsupportedOperationException
.
logTreeProb
in class CKYItem
CKYItem.logProb()
,
CKYItem.logPrior()
public void setLogTreeProb(double logTreeProb)
UnsupportedOperationException
.
setLogTreeProb
in class CKYItem
logTreeProb
- the log of the probability of generating all of this
item's children the log of the probability of generating
all of this item's childrenCKYItem.logTreeProb()
public double outsideProb()
public void setOutsideProb(double outsideProb)
outsideProb
- the outside probability to be set for this itempublic void increaseOutsideProb(double amount)
amount
- the amount to increase the outside probability of this itempublic double insideProb()
public void setInsideProb(double insideProb)
insideProb
- the inside probability to set for this itempublic void increaseInsideProb(double amount)
amount
- the amount by which to increase the inside probability
of the derivations represented by this itempublic EMItem.AntecedentPair antecedentPairs()
public void setAntecedentPairs(EMItem.AntecedentPair pair)
pair
- the list of antecedent pairs for this itempublic int unaryLevel()
public void setUnaryLevel(int unaryLevel)
unaryLevel
- the unary production level to be set for this itempublic Item clear()
clear
in class CKYItem
public boolean equals(Object obj)
EMItem
.
equals
in class CKYItem.MappedPrevModBaseNPAware
obj
- the object to compare with this item
EMItem
public String toString()
toString
in class CKYItem
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |