package projections
- Alphabetic
- Public
- All
Type Members
-
class
AnchoredForestProjector
extends Serializable
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()
-
case class
AnchoredPCFGProjector
[L, W](threshold: Double = Double.NegativeInfinity) extends ChartProjector[L, W] with Product with Serializable
Creates a locally-normalized anchored PCFG from some refined forest.
-
case class
AnchoredRuleMarginalProjector
[L, W](threshold: Double = Double.NegativeInfinity) extends ChartProjector[L, W] with Product with Serializable
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()
-
class
AnchoredSpanProjector
extends Serializable
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()
-
trait
ChartProjector
[L, W] extends AnyRef
Projects a chart to a span anchoring
-
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
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()
-
trait
GoldTagPolicy
[L] extends AnyRef
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.
-
final
case class
GrammarRefinements
[C, F](labels: ProjectionIndexer[C, F], rules: ProjectionIndexer[Rule[C], Rule[F]]) extends Product with Serializable
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()
-
case class
LabeledSpanProjector
[L, W](topology: RuleTopology[L], threshold: Double = Double.NegativeInfinity) extends ChartProjector[L, W] with Product with Serializable
Creates a grammar using only span marginals and unary rule marginals
-
class
OracleParser
[L, L2, W] extends SerializableLogging
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
-
class
ParserChartConstraintsFactory
[L, W] extends Factory[L, W] with Serializable with SerializableLogging
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()
- case class ProjectingCoreGrammar [L, W](parser: Parser[L, W], projector: ChartProjector[L, W]) extends Grammar[L, W] with Product with Serializable
-
final
class
ProjectionIndexer
[C, F] extends (Int) ⇒ Int with Serializable
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()
-
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
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
- object AnchoredForestProjector extends Serializable
- object AnchoredSpanProjector extends Serializable
- object EnumeratedAnchoring extends Serializable
- object GoldTagPolicy
- object GrammarRefinements extends Serializable
- object OracleParser extends Serializable
- object ParserChartConstraintsFactory extends Serializable
-
object
PrecacheConstraints
extends SerializableLogging
Object for creating epic.constraints.CachedChartConstraintsFactory from a parser and prepopulating it with the contents of a treebank.
- object ProjectionIndexer extends Serializable