discodop.estimates¶
Computation of outside estimates for best-first or A* parsing.
- PCFG A* estimate (Klein & Manning 2003). http://aclweb.org/anthology/N03-1016
- PLCFRS LR context-summary estimate (Kallmeyer & Maier 2010). http://aclweb.org/anthology/C10-1061
The latter ported almost directly from rparse (except for sign reversal of log probs).
Functions
getestimates(Grammar grammar, …) |
Compute table of outside SX simple LR estimates for a PLCFRS. |
getpcfgestimates(Grammar grammar, …) |
Compute table of outside SX estimates for a PCFG. |
getpcfgestimatesrec(Grammar grammar, …) |
|
inside(Grammar grammar, uint32_t maxlen, …) |
Compute inside estimate in bottom-up fashion, with full bit vectors. |
outsidelr(Grammar grammar, double[, , …) |
Compute the outside SX simple LR estimate in top down fashion. |
simpleinside(Grammar grammar, …) |
Compute simple inside estimate in bottom-up fashion. |
test() |
|
testestimates(Grammar grammar, …) |
Classes
Item |
Item class used in agenda for computing the outside LR estimate. |
-
class
discodop.estimates.Item¶ Item class used in agenda for computing the outside LR estimate.
-
discodop.estimates.getestimates(Grammar grammar, uint32_t maxlen, unicode rootlabel)¶ Compute table of outside SX simple LR estimates for a PLCFRS.
-
discodop.estimates.getpcfgestimates(Grammar grammar, uint32_t maxlen, unicode rootlabel, bool debug=False)¶ Compute table of outside SX estimates for a PCFG.
-
discodop.estimates.inside(Grammar grammar, uint32_t maxlen, dict insidescores)¶ Compute inside estimate in bottom-up fashion, with full bit vectors.
(not used).
-
discodop.estimates.outsidelr(Grammar grammar, double[:, :] insidescores, uint32_t maxlen, Label goal, double[:, :, :, :] outside)¶ Compute the outside SX simple LR estimate in top down fashion.
-
discodop.estimates.simpleinside(Grammar grammar, uint32_t maxlen, double[:, :] insidescores)¶ Compute simple inside estimate in bottom-up fashion. Here vec is actually the length (number of terminals in the yield of the constituent) insidescores is a 2-dimensional matrix initialized with NaN to indicate values that have yet to be computed.