|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.Chart
danbikel.parser.CKYChart
public class CKYChart
Implementation of a chart for probabilistic Cocke-Kasami-Younger (CKY) parsing.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class danbikel.parser.Chart |
---|
Chart.Entry |
Field Summary |
---|
Fields inherited from class danbikel.parser.Chart |
---|
cellLimit, chart, debugNumItemsGenerated, debugNumPrunedItems, itemPool, numPrePruned, numPruned, pruneFact, pruning, relax, size, totalItems, totalItemsGenerated |
Constructor Summary | |
---|---|
CKYChart()
Constructs a new chart with the default chart size. |
|
CKYChart(int size)
Constructs a new chart with the specified chart size. |
|
CKYChart(int cellLimit,
double pruneFact)
Constructs a new chart with a default initial chart size, and with the specified cell limit and prune factor. |
|
CKYChart(int size,
int cellLimit,
double pruneFact)
Constructs a new chart with the specified initial chart size, cell limit and prune factor. |
Method Summary | |
---|---|
protected boolean |
cellLimitShouldApplyTo(Item item)
Returns true if the specified item has received its
stop probabilities (that is, if item.stop() == true ). |
void |
clearNonPreterminals()
Used by the decoder when it abandons a parse forest for a given sentence and is about to try again with a larger beam (beam-widening). |
CKYItem |
getNewItem()
Returns a new chart item from the internal pool of reusable items. |
protected boolean |
outsideBeam(Item item,
double topProb)
Returns whether the specified chart item is outside the beam given the specified top log prob. |
protected void |
reclaimItemCollection(Collection c)
A hook called by Chart.reclaimItemsInChart() to allow subclasses
to reclaim each span's collection of chart items. |
protected void |
setUpItemPool()
Sets up the item object pools. |
Methods inherited from class danbikel.parser.Chart |
---|
add, clear, dontDoPruning, dontRelax, doPruning, get, getTopItem, getTopLogProb, numItems, postParseCleanup, prune, reclaimItem, reclaimItemsInChart, relax, resetTopLogProb, setPruneFactor, setSize, setSizeAndClear, toPrune |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CKYChart()
public CKYChart(int size)
size
- the initial size of this chartpublic CKYChart(int cellLimit, double pruneFact)
cellLimit
- the limit to the number of items per cellpruneFact
- that log of the prune factorChart.cellLimit
,
Chart.pruneFact
public CKYChart(int size, int cellLimit, double pruneFact)
size
- the initial size of this chartcellLimit
- the limit to the number of items per cellpruneFact
- that log of the prune factorChart.cellLimit
,
Chart.pruneFact
Method Detail |
---|
public void clearNonPreterminals()
Settings.decoderMaxPruneFactor
,
Settings.decoderPruneFactorIncrement
protected boolean outsideBeam(Item item, double topProb)
Chart
outsideBeam
in class Chart
item
- the item to be tested for inclusion within the beamtopProb
- the log prob of the top-ranked item for the specified item's
span
protected void setUpItemPool()
Chart
setUpItemPool
in class Chart
public CKYItem getNewItem()
protected void reclaimItemCollection(Collection c)
Chart
Chart.reclaimItemsInChart()
to allow subclasses
to reclaim each span's collection of chart items.
reclaimItemCollection
in class Chart
c
- the collection of chart items to be reclaimedprotected boolean cellLimitShouldApplyTo(Item item)
true
if the specified item has received its
stop probabilities (that is, if item.stop() == true
).
cellLimitShouldApplyTo
in class Chart
item
- the item to be tested
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |