package parser
- Alphabetic
- By Inheritance
- parser
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
AnchoredVisitor
[L] extends AnyRef
A class that asks about all anchored spans.
A class that asks about all anchored spans. It's the "foreach" version of a epic.parser.GrammarAnchoring that takes in expected counts. score is usually an expected count between 0 and 1.
-
trait
ChartDecoder
[L, W] extends Serializable
A ChartDecoder converts marginals into a binarized tree.
A ChartDecoder converts marginals into a binarized tree. Post-processing to debinarize and strip useless annotations is still necessary.
-
case class
EPChartFactory
[L, W](topology: RuleTopology[L], lexicon: Lexicon[L, W], epInference: EPInference[TreeInstance[L, W], UnrefinedGrammarAnchoring[L, W]]) extends Factory[L, W] with SerializableLogging with Product with Serializable
TODO
-
trait
Grammar
[L, W] extends Serializable
TODO docs
-
trait
GrammarAnchoring
[L, W] extends AnyRef
A GrammarAnchoring is a grammar that has been tuned to a particular sentence (if applicable).
A GrammarAnchoring is a grammar that has been tuned to a particular sentence (if applicable). It knows how to do two things: assign scores to rules and spans, and determine reachability of various refinements.
It might be nice to consider a refined grammar that doesn't need sentence-specific tuning, but that interferes with integrating lexicalization into the framework.
- case class LatentTreeMarginal [L, W](anchoring: GrammarAnchoring[L, W], tree: BinarizedTree[IndexedSeq[(L, Int)]]) extends ParseMarginal[L, W] with Product with Serializable
-
class
MaxConstituentDecoder
[L, W] extends ChartDecoder[L, W]
Attempts to find a parse that maximizes the expected number of correct labels.
Attempts to find a parse that maximizes the expected number of correct labels. This is Goodman's MaxRecall algorithm.
- L
label type
- W
word type
- Annotations
- @SerialVersionUID()
-
case class
MaxRuleProductDecoder
[L, W]() extends ProjectingChartDecoder[L, W] with Product with Serializable
Tries to extract a tree that maximizes rule product in the coarse grammar.
Tries to extract a tree that maximizes rule product in the coarse grammar. This is Slav's Max-Rule-Product
- Annotations
- @SerialVersionUID()
-
case class
MaxVariationalDecoder
[L, W]() extends ProjectingChartDecoder[L, W] with Product with Serializable
Projects a tree to an anchored PCFG and then does viterbi on that tree.
Projects a tree to an anchored PCFG and then does viterbi on that tree. This is the Max-Variational method in Matsuzaki
- case class NoParseException (msg: String, sentence: IndexedSeq[Any], cause: Throwable = null) extends RuntimeException with ParserException with Product with Serializable
-
class
ParseEval
[L] extends AnyRef
Hack approximation to true parse eval.
Hack approximation to true parse eval. Gives Labeled Precision and Labeled Recall.
- case class ParseExtractionException (msg: String, sentence: IndexedSeq[Any]) extends RuntimeException with ParserException with Product with Serializable
-
trait
ParseMarginal
[L, W] extends VisitableMarginal[AnchoredVisitor[L]]
Represents marginals over trees.
Represents marginals over trees. Can also extract expected counts
-
final
case class
Parser
[L, W](topology: RuleTopology[L], lexicon: Lexicon[L, W], constraintsFactory: Factory[L, W], marginalFactory: Factory[L, W], decoder: ChartDecoder[L, W] = ChartDecoder[L, W]())(implicit debinarizer: Debinarizer[L]) extends (IndexedSeq[W]) ⇒ Tree[L] with Product with Serializable
A Parser produces a syntactic representation of a sentence, called a epic.trees.Tree, which has internal nodes that demarcate syntactic functions
A Parser produces a syntactic representation of a sentence, called a epic.trees.Tree, which has internal nodes that demarcate syntactic functions
- Annotations
- @SerialVersionUID()
-
class
ParserAnnotator
[L] extends StringAnalysisFunction[Token with Sentence, Tree[L]]
A ParserAnnotator is a slab-ified epic.parser.Parser.
A ParserAnnotator is a slab-ified epic.parser.Parser. The analogy is that a epic.sequences.Tagger is to epic.sequences.CRF as this class is to epic.parser.Parser.
- trait ParserException extends Exception
-
trait
ParserPipeline
extends SerializableLogging
ParserPipeline is a base-trait for the parser training pipeline.
ParserPipeline is a base-trait for the parser training pipeline. Handles reading in the treebank and params and such
-
class
ProductChartFactory
[L, W] extends Factory[L, W] with SerializableLogging
TODO
-
final
case class
ProductGrammarAnchoring
[L, W](s1: GrammarAnchoring[L, W], s2: GrammarAnchoring[L, W], alpha: Double = 1.0) extends ProductRefinementsHandler[L, W] with GrammarAnchoring[L, W] with Product with Serializable
Creates a product of two derivation scorers, seamlessly combining their refinements as appropriate.
Creates a product of two derivation scorers, seamlessly combining their refinements as appropriate.
This class is the main motivation for the "annotationTag" on epic.parser.GrammarAnchoring instances. If one of the annotation tags is "0" then it does not use refinements, and so we can avoid clever games.
Similarly, if the tags matched, then we can use the same tags. I'm not 100% convinced this is necessary any more. But I have it for now.
- class ProductRefinedFeaturizer [L, W, Feat1, Feat2] extends RefinedFeaturizer[L, W, Either[Feat1, Feat2]]
- abstract class ProductRefinementsHandler [L, W] extends AnyRef
-
final
case class
ProductUnrefinedGrammarAnchoring
[L, W](s1: UnrefinedGrammarAnchoring[L, W], s2: UnrefinedGrammarAnchoring[L, W], alpha: Double = 1.0) extends UnrefinedGrammarAnchoring[L, W] with Product with Serializable
Creates a product of two epic.parser.UnrefinedGrammarAnchorings (product is in log space, so actually a sum.)
-
class
ProductionFeaturizer
[L, L2, W] extends RefinedFeaturizer[L, W, Feature] with Serializable
A simple Featurizer that just counts lexical and rule productions that are used.
A simple Featurizer that just counts lexical and rule productions that are used.
- Annotations
- @SerialVersionUID()
- abstract class ProjectingChartDecoder [L, W] extends ChartDecoder[L, W]
-
trait
ProjectionsGrammarAnchoring
[L, L2, W] extends GrammarAnchoring[L, W]
TODO
-
final
case class
RefinedChartMarginal
[L, W](anchoring: GrammarAnchoring[L, W], inside: RefinedParseChart[L], outside: RefinedParseChart[L], logPartition: Double, isMaxMarginal: Boolean) extends ParseMarginal[L, W] with SerializableLogging with Product with Serializable
Holds the information for the marginals for a sentence.
Holds the information for the marginals for a sentence. That is, the inside and outside scores for a sentence and anchoring.
- L
the label type
- W
the word type
- anchoring
the specialized grammar used to construct the marginals for this sentence
- inside
inside chart
- outside
outside chart
- logPartition
the normalization constant aka inside score of the root aka probability of the sentence
- trait RefinedFeaturizer [L, W, Feat] extends AnyRef
-
class
RefinedParseChart
[L] extends Serializable
- Annotations
- @SerialVersionUID()
-
class
RuleFeaturizer
[L, W] extends RefinedFeaturizer[L, W, Rule[L]]
A simple Featurizer that just counts lexical and rule productions that are used.
-
final
class
RuleTopology
[L] extends Encoder[Rule[L]] with Serializable
A RuleTopology is basically a grammar with no weights.
A RuleTopology is basically a grammar with no weights. It provides lookup methods by rule, by parent, etc.
- Annotations
- @SerialVersionUID()
-
final
case class
SimpleChartMarginal
[L, L2, W](anchoring: Anchoring[L, L2, W], inside: SimpleParseChart[L2], outside: SimpleParseChart[L2], isMaxMarginal: Boolean = true) extends ParseMarginal[L, W] with Product with Serializable
TODO
-
class
SimpleGrammar
[L, L2, W] extends Grammar[L, W] with Serializable
A epic.parser.SimpleGrammar is a grammar where the topology of the grammar (including the refinements) and the scores for the rules does not vary with the input sentence.
A epic.parser.SimpleGrammar is a grammar where the topology of the grammar (including the refinements) and the scores for the rules does not vary with the input sentence. That is, this is the class for the standard kind of PCFG/WCFG that are normally taught.
- Annotations
- @SerialVersionUID()
-
final
class
SimpleParseChart
[L] extends Serializable
- Annotations
- @SerialVersionUID()
-
final
class
SparseRuleTensor
[L] extends Serializable
This class is mostly an implementation detail.
This class is mostly an implementation detail. It's used for epic.parser.SimpleGrammar instances to accelerate parsing. It's kind of like a compressed sparse columns matrix (breeze.linalg.CSCMatrix), but it's a 3-d tensor instead of a 2-d matrix.
- Annotations
- @SerialVersionUID()
-
case class
StandardChartFactory
[L, W](refinedGrammar: Grammar[L, W], maxMarginal: Boolean = false) extends Factory[L, W] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
case class
TreeMarginal
[L, W](anchoring: GrammarAnchoring[L, W], tree: BinarizedTree[(L, Int)]) extends ParseMarginal[L, W] with Product with Serializable
This isn't really a marginal, except in a degenerate sense.
This isn't really a marginal, except in a degenerate sense. It gives the likelihood of a known fixed tree under the Anchoring as well as expected counts (i.e. count the occurrences of each rule.)
- anchoring
The grammar anchoring
- tree
A tree that has been decorated with the gold refinements at each leaf
-
trait
UnrefinedGrammarAnchoring
[L, W] extends GrammarAnchoring[L, W] with Factor[UnrefinedGrammarAnchoring[L, W]]
epic.parser.UnrefinedGrammarAnchoring score rules and labels in a particular context without needed extra "refined" categories.
epic.parser.UnrefinedGrammarAnchoring score rules and labels in a particular context without needed extra "refined" categories. That is, an anchoring can score x-bar spans in a particular context.
- Annotations
- @SerialVersionUID()
-
case class
ViterbiDecoder
[L, W]() extends ChartDecoder[L, W] with Serializable with SerializableLogging with Product
Tries to extract a tree that maximizes log score.
Tries to extract a tree that maximizes log score.
- Annotations
- @SerialVersionUID()
Value Members
- object ChartDecoder extends Serializable
- object EPChartFactory extends Serializable
-
object
GenerativeParser
Contains codes to read off parsers and grammars from a treebank.
- object GenerativeTrainer extends ParserPipeline
- object Grammar extends Serializable
- object GrammarAnchoring
- object LatentTreeMarginal extends Serializable
- object ParseEval extends SerializableLogging
- object ParseMarginal
-
object
ParseText
extends ProcessTextMain[Parser[AnnotatedLabel, String], Tree[AnnotatedLabel]]
Simple class that reads in a bunch of files and parses them.
Simple class that reads in a bunch of files and parses them. Output is dumped to standard out.
- object Parser extends Serializable
-
object
ParserParams
Mostly a utility class for parsertrainers.
-
object
ParserTester
ParserTester just tests a grammar reading in the treebank and params and such
- object RefinedChartMarginal extends Serializable
- object RefinedParseChart extends Serializable
- object RuleTopology extends Serializable
- object SimpleChartMarginal extends Serializable
- object SimpleGrammar extends Serializable
- object SparseRuleTensor extends Serializable
-
object
TinyRuleTest
extends App
TODO
- object TinyRuleTestRedux extends App
- object TreeMarginal extends Serializable
- object UnrefinedGrammarAnchoring