org.allenai.nlpstack.parse.poly

reranking

package reranking

Visibility
  1. Public
  2. All

Type Members

  1. class ExtractorBasedNeighborhoodSource extends NeighborhoodSource

    Applies a ParseNeighborhoodExtractor to all parses in a PolytreeParseSource and returns an iterator over all of the extracted neighborhoods.

  2. case class KeywordNhTransform(keywords: Seq[String]) extends NeighborhoodTransform with Product with Serializable

    Creates a feature for every keyword (from a dictionary of keywords) that appears in the input neighborhood.

    Creates a feature for every keyword (from a dictionary of keywords) that appears in the input neighborhood.

    Note that the keyword matching is case-insensitive.

    keywords

    the set of words to consider

  3. case class LinearParseRerankingFunction(feature: PolytreeParseFeature, linearModel: Option[LinearModel]) extends RerankingFunction with Product with Serializable

    Rescores a parse tree based on a linear combination of features.

    Rescores a parse tree based on a linear combination of features.

    feature

    computes a feature vector from the parse tree

    linearModel

    computes a linear combination of the computed features

  4. case class NeighborhoodEventStatistic(neighborhoodSource: NeighborhoodSource, eventTransform: NeighborhoodTransform) extends Product with Serializable

    Collects statistics over "neighborhood events."

    Collects statistics over "neighborhood events."

    An example might help. A neighborhood is a collection of tokens, e.g. a node and its children in a dependency parse. A neighborhood event is a mapping of these tokens to a sequence of strings, e.g. we might map each token to its part-of-speech tag.

    Given a corpus of dependency parses, we might want to collect a histogram that tells us how many times each neighborhood event like (VERB, NOUN, NOUN) occurs in the corpus. This is what the NeighborhoodEventStatistic does.

    neighborhoodSource

    provides a stream of neighborhoods

    eventTransform

    a transformation from neighborhoods to events

  5. trait NeighborhoodExtractor extends (PolytreeParse, Int) ⇒ Seq[Neighborhood]

    Maps a parse tree node to one or more of its neighborhoods.

    Maps a parse tree node to one or more of its neighborhoods.

    Different extractors will define "neighborhood" in different ways. For instance, one might want to consider neighborhoods like: - a node and its children - a node and its parents - a node and its breadcrumb

  6. trait NeighborhoodTransform extends (PolytreeParse, Neighborhood) ⇒ Seq[FeatureName]

    A NeighborhoodTransform maps a Neighborhood to zero or more feature names.

    A NeighborhoodTransform maps a Neighborhood to zero or more feature names.

    An example might help. Suppose that we have a neighborhood consisting of (node, child1, child2), i.e. three nodes of a parse tree. A transform might map these to the sequence of their POS tags, e.g. FeatureName(Seq('VERB, 'NOUN, 'NOUN)).

  7. case class PRTCommandLine(nbestFilenames: String = "", otherNbestFilename: String = "", parserFilename: String = "", goldParseFilename: String = "", dataSource: String = "", clustersPath: String = "", rerankerFilename: String = "", otherGoldParseFilename: String = "", taggersConfigPathOption: Option[String] = None) extends Product with Serializable

  8. class ParseNeighborhoodExtractor extends AnyRef

    Applies a NeighborhoodExtractor to all tokens in a parse tree and returns an iterator over all of the extracted neighborhoods.

  9. abstract class ParseNodeFeature extends (PolytreeParse, Int) ⇒ FeatureVector

    Maps a selected node of a parse tree into a feature vector.

  10. case class ParseNodeFeatureUnion(features: Seq[ParseNodeFeature]) extends ParseNodeFeature with Product with Serializable

    A ParseNodeFeatureUnion merges the output of a list of features.

    A ParseNodeFeatureUnion merges the output of a list of features.

    features

    a list of the features we want to merge into a single feature

  11. case class ParseRerankerCommandLine(parserFilename: String = "", goldParseFilename: String = "", dataSource: String = "", rerankerFilename: String = "", diagnosticFilename: String = "") extends Product with Serializable

  12. case class ParseRerankingFunction(scoringFunction: ParseScore) extends RerankingFunction with Product with Serializable

    Rescores a parse tree according to a specified scoring function.

    Rescores a parse tree according to a specified scoring function.

    scoringFunction

    the desired scoring function

  13. abstract class PolytreeParseFeature extends (PolytreeParse, Double) ⇒ FeatureVector

    Maps a scored parse into a feature vector.

  14. case class PolytreeParseFeatureUnion(features: Seq[PolytreeParseFeature]) extends PolytreeParseFeature with Product with Serializable

    A PolytreeParseFeatureUnion merges the output of a list of features.

    A PolytreeParseFeatureUnion merges the output of a list of features.

    features

    a list of the features we want to merge into a single feature

  15. case class PropertyNhTransform(propertyName: Symbol) extends NeighborhoodTransform with Product with Serializable

    Maps the tokens of a neighborhood to a particular property in their token's property map.

    Maps the tokens of a neighborhood to a particular property in their token's property map.

    propertyName

    name of the desired property

  16. case class QECommandLine(rerankerFilename: String = "", parserFilename: String = "", goldParseFilename: String = "", dataSource: String = "") extends Product with Serializable

  17. case class RerankingFunctionTrainer(parseNodeFeature: ParseNodeFeature) extends Product with Serializable

  18. case class SelfAndSpecificChildExtractor(k: Int) extends NeighborhoodExtractor with Product with Serializable

    Extracts neighborhood (child_k, token), where child_k is the kth child of the input token.

    Extracts neighborhood (child_k, token), where child_k is the kth child of the input token.

    If the input token does not have a kth child, the apply operation will return the empty sequence.

  19. case class SelfAndSpecificParentExtractor(parentIndex: Int) extends NeighborhoodExtractor with Product with Serializable

    Extracts neighborhood (parent_k, token), where parent_k is the kth parent of the input token.

    Extracts neighborhood (parent_k, token), where parent_k is the kth parent of the input token.

    If the input token does not have a kth parent, the apply operation will return the empty sequence.

  20. case class SpecificChildExtractor(k: Int) extends NeighborhoodExtractor with Product with Serializable

    Extracts neighborhood (child_k), where child_k is the kth child of the input token.

    Extracts neighborhood (child_k), where child_k is the kth child of the input token.

    If the input token does not have a kth child, the apply operation will return the empty sequence.

  21. case class SpecificParentExtractor(parentIndex: Int) extends NeighborhoodExtractor with Product with Serializable

    Extracts neighborhood (parent_k), where parent_k is the kth parent of the input token.

    Extracts neighborhood (parent_k), where parent_k is the kth parent of the input token.

    If the input token does not have a kth parent, the apply operation will return the empty sequence.

  22. case class SuffixNhTransform(keysuffixes: Seq[String]) extends NeighborhoodTransform with Product with Serializable

    Creates a feature for every suffix (from a dictionary of suffixes) that appears in the input neighborhood.

    Creates a feature for every suffix (from a dictionary of suffixes) that appears in the input neighborhood.

    keysuffixes

    the set of suffixes to consider

  23. case class TransformedNeighborhoodFeature(neighborhoodExtractors: Seq[(String, NeighborhoodExtractor)], transforms: Seq[(String, NeighborhoodTransform)]) extends ParseNodeFeature with Product with Serializable

    A TransformedNeighborhoodFeature creates a feature vector from a set of neighborhood extractors and transforms.

    A TransformedNeighborhoodFeature creates a feature vector from a set of neighborhood extractors and transforms.

    neighborhoodExtractors

    the neighborhood extractors you want to apply to each parse node

    transforms

    the transforms you want to apply to the extracted neighborhoods

  24. case class VerbnetTransform(verbnet: Verbnet) extends NeighborhoodTransform with Product with Serializable

    Creates a feature per frame for all verbnet frames corresponding to the tokens in the input neighborhood.

    Creates a feature per frame for all verbnet frames corresponding to the tokens in the input neighborhood.

    verbnet

    the Verbnet utility object to query

  25. case class WeirdParseNodeRerankingFunction(classifier: WrapperClassifier, feature: ParseNodeFeature, weirdnessThreshold: Double) extends RerankingFunction with Product with Serializable

    This reranking function attempts to rerank parses based on how many "weird" nodes they have, according to a "weirdness" classifier.

    This reranking function attempts to rerank parses based on how many "weird" nodes they have, according to a "weirdness" classifier.

    classifier

    the weirdness classifier

    feature

    computes a feature vector from a parse tree node

    weirdnessThreshold

    the minimum probability of weirdness in order for a node to count as "weird"

  26. case class WeirdnessAnalyzer(rerankingFunction: WeirdParseNodeRerankingFunction) extends Product with Serializable

    A parse statistic that collects weirdness statistics for candidate parses.

    A parse statistic that collects weirdness statistics for candidate parses.

    rerankingFunction

    the weirdness reranking function

Value Members

  1. object AllChildrenExtractor extends NeighborhoodExtractor with Product with Serializable

    Extracts the neighborhood (child1, ..., childK) from a parse tree, where childI is the Ith child of the input token.

  2. object AllParentsExtractor extends NeighborhoodExtractor with Product with Serializable

    Extracts the neighborhood (parent1, ..., parentK) from a parse tree, where parentI is the Ith parent of the input token.

  3. object ArclabelNhTransform extends NeighborhoodTransform with Product with Serializable

    Creates a feature for the label on the arc connecting two tokens in a two-token neighborhood.

    Creates a feature for the label on the arc connecting two tokens in a two-token neighborhood.

    Note that the apply operator will throw an exception if the argument neighborhood does not have exactly two tokens. It will also throw an exception if the parse does not contains an arc between the two neighborhood nodes.

  4. object BaseParserScoreFeature extends PolytreeParseFeature with Product with Serializable

    Simply passes along the original score of the parse as a feature.

  5. object CardinalityNhTransform extends NeighborhoodTransform with Product with Serializable

    Creates a feature describing the cardinality of a neighborhood, i.e.

    Creates a feature describing the cardinality of a neighborhood, i.e. the number of tokens in the neighborhood.

  6. object DirectionNhTransform extends NeighborhoodTransform with Product with Serializable

    Creates a feature describing the order of two tokens in a two-token neighborhood.

    Creates a feature describing the order of two tokens in a two-token neighborhood.

    Specifically, it will be 'L if the first token appears to the left of the second token in the sentence. Otherwise, it will be 'R.

    Note that the apply operator will throw an exception if the argument neighborhood does not have exactly two tokens. It will also throw an exception if the two tokens are the same (i.e. neither appears to the left of the other).

  7. object EachChildExtractor extends NeighborhoodExtractor with Product with Serializable

    Extracts all neighborhoods of the form (child) from a parse tree, where child is one of the children of the input token.

  8. object EachParentExtractor extends NeighborhoodExtractor with Product with Serializable

    Extracts all neighborhoods of the form (parent) from a parse tree, where parent is one of the parents of the input token.

  9. object NeighborhoodEventStatistic extends Serializable

  10. object NeighborhoodExtractor

  11. object NeighborhoodTransform

  12. object OracleReranker

  13. object ParseNodeFeature

  14. object ParseReranker

    This command-line takes a serialized reranking function and uses it to rerank an n-best list.

    This command-line takes a serialized reranking function and uses it to rerank an n-best list. The resulting parses are then evaluated against a gold set.

  15. object ParseRerankerTraining

    A command-line that shows the way towards possibly better parse reranking.

    A command-line that shows the way towards possibly better parse reranking.

    This trains a "weirdness" classifier that learns to classify parse tree nodes as "weird" or not "weird," which can be used to rerank parses based on how many of their nodes are classified as "weird."

  16. object PolytreeParseFeature

  17. object QualityEstimation

    A command-line that plots an accuracy/yield curve, given a reranking function and a parser.

  18. object SelfExtractor extends NeighborhoodExtractor with Product with Serializable

    Extracts neighborhood (token) from the parse tree.

  19. object SentenceLengthFeature extends PolytreeParseFeature with Product with Serializable

    Simply passes along the length of the sentence as a feature.

Ungrouped