Package

epic.parser

projections

Permalink

package projections

Visibility
  1. Public
  2. All

Type Members

  1. class AnchoredForestProjector extends Serializable

    Permalink

    Used for computing the x-bar parse forest from a epic.parser.ParseMarginal.

    Used for computing the x-bar parse forest from a epic.parser.ParseMarginal.

    Annotations
    @SerialVersionUID()
  2. case class AnchoredPCFGProjector[L, W](threshold: Double = Double.NegativeInfinity) extends ChartProjector[L, W] with Product with Serializable

    Permalink

    Creates a locally-normalized anchored PCFG from some refined forest.

  3. case class AnchoredRuleMarginalProjector[L, W](threshold: Double = Double.NegativeInfinity) extends ChartProjector[L, W] with Product with Serializable

    Permalink

    Creates anchorings for a set of trees from some parser using p(rule | sentence) marginals.

    Creates anchorings for a set of trees from some parser using p(rule | sentence) marginals.

    Annotations
    @SerialVersionUID()
  4. class AnchoredSpanProjector extends Serializable

    Permalink

    Used for computed the expected number of anchored labels that occur at each span

    Used for computed the expected number of anchored labels that occur at each span

    Annotations
    @SerialVersionUID()
  5. trait ChartProjector[L, W] extends AnyRef

    Permalink

    Projects a chart to a span anchoring

  6. case class EnumeratedAnchoring[L, W](topology: RuleTopology[L], lexicon: Lexicon[L, W], words: IndexedSeq[W], spanScores: Array[OpenAddressHashArray[Double]], unaryScores: Array[OpenAddressHashArray[Double]], binaryScores: Array[Array[OpenAddressHashArray[Double]]], sparsityPattern: ChartConstraints[L]) extends UnrefinedGrammarAnchoring[L, W] with Serializable with Product with Serializable

    Permalink

    An epic.parser.projections.EnumeratedAnchoring is a compressed forest, with potentially distinct rule and span scores for every possible anchoring into the sentence.

    An epic.parser.projections.EnumeratedAnchoring is a compressed forest, with potentially distinct rule and span scores for every possible anchoring into the sentence. Commonly produced by either an epic.parser.projections.AnchoredPCFGProjector (for PCFG forests) or an epic.parser.projections.AnchoredRuleMarginalProjector (for rule marginal forests).

    Annotations
    @SerialVersionUID()
  7. trait GoldTagPolicy[L] extends AnyRef

    Permalink

    GoldTagPolicys are used in places where sometimes (mostly for debugging) we'd like to know which labeled spans are "gold" (correct) and which are not.

  8. final case class GrammarRefinements[C, F](labels: ProjectionIndexer[C, F], rules: ProjectionIndexer[Rule[C], Rule[F]]) extends Product with Serializable

    Permalink

    Handles the mapping between a coarser grammar and a finer grammar.

    Handles the mapping between a coarser grammar and a finer grammar. (For example, an xbar grammar and an xbar grammar with latent variables.) It mostly just aggregates two epic.projections.ProjectionIndexers, one for labels and one for rules. It also provides convenience methods for, e.g., getting all rule refinements that have a given parent refinment.

    Refined symbols and rules are given a "local" integer index that is specific to a coarse symbol. For example, NP-4 might have "global index" 37 for all symbols, but will have NP-specific local index 4. Analogously, NP-4 -> NP-3 PP-2 will have a NP -> NP PP specific local index.

    Annotations
    @SerialVersionUID()
  9. case class LabeledSpanProjector[L, W](topology: RuleTopology[L], threshold: Double = Double.NegativeInfinity) extends ChartProjector[L, W] with Product with Serializable

    Permalink

    Creates a grammar using only span marginals and unary rule marginals

  10. class OracleParser[L, L2, W] extends SerializableLogging

    Permalink

    Finds the best tree (relative to the gold tree) s.t.

    Finds the best tree (relative to the gold tree) s.t. it's reacheable given the current anchoring. Best is measured as number of correct labeled spans, as usual. If the given treebank symbol is correct, bonus points can be awarded for getting the right refinement.

    On the training set, the "best" reachable tree will not always (~5% of the time) be the correct tree, because pruning will remove the right answer. We don't want to try to train towards an unreachable tree, because the training algorithm will do bad things. Instead, we want the best possible tree that our parser could conceivably produce. That is why this class exists.

    If backupGrammar is provided, it will be used to find such a tree in the case that no tree can be found with grammar (given the current constraints).

    Typically, the first grammar will be a treebank grammar that has no horizontal markovization (i.e. it is not forgetfully binarized) and it also remembers the functional tags like -TMP. The backup grammar is usually the grammar with which the pruning masks were produced; because of the way we prune, that parser will always be able to find a tree (assuming that it was able to find a tree without pruning.)

    TODO: should be a cascade of grammars

  11. class ParserChartConstraintsFactory[L, W] extends Factory[L, W] with Serializable with SerializableLogging

    Permalink

    Creates labeled span scorers for a set of trees from some parser.

    Creates labeled span scorers for a set of trees from some parser.

    Annotations
    @SerialVersionUID()
  12. case class ProjectingCoreGrammar[L, W](parser: Parser[L, W], projector: ChartProjector[L, W]) extends Grammar[L, W] with Product with Serializable

    Permalink

  13. final class ProjectionIndexer[C, F] extends (Int) ⇒ Int with Serializable

    Permalink

    For computing projections from a fine grammar to a coarse grammar.

    For computing projections from a fine grammar to a coarse grammar.

    There are two indexes maintained for the fine symbols: a globally unique id, and a local per-symbol id (in the range 0...numRefinements(coarseSym).

    Yuck.

    Annotations
    @SerialVersionUID()
  14. case class SpanAnchoring[L, W](topology: RuleTopology[L], lexicon: Lexicon[L, W], words: IndexedSeq[W], sparsityPattern: ChartConstraints[L], spanScores: Array[OpenAddressHashArray[Double]], unaryScores: Array[OpenAddressHashArray[Double]]) extends UnrefinedGrammarAnchoring[L, W] with Product with Serializable

    Permalink

    A SpanAnchoring just scores spans and unary rules.

    A SpanAnchoring just scores spans and unary rules. BinaryRules are all given score 0.0

    Annotations
    @SerialVersionUID()

Value Members

  1. object AnchoredForestProjector extends Serializable

    Permalink
  2. object AnchoredSpanProjector extends Serializable

    Permalink
  3. object EnumeratedAnchoring extends Serializable

    Permalink
  4. object GoldTagPolicy

    Permalink
  5. object GrammarRefinements extends Serializable

    Permalink
  6. object OracleParser extends Serializable

    Permalink
  7. object ParserChartConstraintsFactory extends Serializable

    Permalink
  8. object PrecacheConstraints extends SerializableLogging

    Permalink

    Object for creating epic.constraints.CachedChartConstraintsFactory from a parser and prepopulating it with the contents of a treebank.

  9. object ProjectionIndexer extends Serializable

    Permalink

Ungrouped