|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.ProbabilityStructure
danbikel.parser.ms.BrokenModWordModelStructure
public class BrokenModWordModelStructure
Provides the complete back-off structure for the submodel that generates
the head words of modifying nonterminals. This class is just like
ModWordModelStructure2
but is “broken” in the
sense that it includes side information when generating histories
for the last back-off level, as indicated by Collins’ thesis,
but as was not implemented by Collins in his actual thesis parser,
which collapsed all words when computing
p(w | t).
Field Summary |
---|
Fields inherited from class danbikel.parser.ProbabilityStructure |
---|
additionalData, defaultModelClassName, defaultModelConstructor, doPruning, estimates, futureList, futures, futuresWithSubcats, histories, historiesWithSubcats, historyList, lambdas, prevHistCount, topLevelCacheSize, transitions |
Constructor Summary | |
---|---|
BrokenModWordModelStructure()
Constructs a new instance. |
Method Summary | |
---|---|
ProbabilityStructure |
copy()
Returns a copy of this object. |
boolean |
doCleanup()
Returns true, indicating that the Model that owns an
instance of this class ought to call its Model.cleanup() method at
the end of execution of its deriveCounts
method. |
Event |
getFuture(TrainerEvent trainerEvent,
int backOffLevel)
Returns an event whose sole component is the word being generated as the head of some modifier nonterminal. |
Event |
getHistory(TrainerEvent trainerEvent,
int backOffLevel)
Returns the history event corresponding to the specified back-off level. |
int |
maxEventComponents()
Returns 10. |
int |
numLevels()
Returns 3. |
boolean |
removeHistory(int backOffLevel,
Event history)
In order to gather statistics for words that appear as the head of the entire sentence when estimating p^(w | t), the trainer “fakes” a modifier event, as though the root node of the observed tree was seen to modify the magical +TOP+ node. |
Methods inherited from class danbikel.parser.ProbabilityStructure |
---|
cacheSize, defaultSmoothingParamsFilename, dontAddNewParameters, doPruning, getAdditionalData, getTopLevelCacheSize, getTransition, jointModel, lambdaFudge, lambdaFudgeTerm, lambdaPenalty, newModel, priorLevel, removeFuture, removeTransition, saveSmoothingParameters, setAdditionalData, smoothingParametersFile, useSmoothingParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrokenModWordModelStructure()
Method Detail |
---|
public int maxEventComponents()
maxEventComponents
in class ProbabilityStructure
MutableEvent.ensureCapacity(int)
public int numLevels()
numLevels
in class ProbabilityStructure
public Event getHistory(TrainerEvent trainerEvent, int backOffLevel)
getHistory
in class ProbabilityStructure
trainerEvent
- the maximal-context event from which to derive
the history contexts used by the probability structure provided by
this classbackOffLevel
- the back-off level for which to return a history
context
public Event getFuture(TrainerEvent trainerEvent, int backOffLevel)
getFuture
in class ProbabilityStructure
trainerEvent
- the maximal-context event for which to get a futurebackOffLevel
- the level of back-off for which a probability is being
computed
public boolean doCleanup()
Model
that owns an
instance of this class ought to call its Model.cleanup()
method at
the end of execution of its deriveCounts
method.
doCleanup
in class ProbabilityStructure
ProbabilityStructure.removeHistory(int,Event)
,
ProbabilityStructure.removeFuture(int,Event)
,
ProbabilityStructure.removeTransition(int,Transition)
,
Model.deriveCounts(CountsTable,danbikel.util.Filter,double,danbikel.util.FlexibleMap)
,
Model.cleanup()
public boolean removeHistory(int backOffLevel, Event history)
removeHistory
in class ProbabilityStructure
backOffLevel
- the back-off level of the history context being tested
for removalhistory
- the history context being tested for removalModel.deriveCounts(CountsTable,danbikel.util.Filter,double,danbikel.util.FlexibleMap)
,
Model.cleanup()
public ProbabilityStructure copy()
copy
in class ProbabilityStructure
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |