org.allenai.nlpstack.parse.poly

fsm

package fsm

Visibility
  1. Public
  2. All

Type Members

  1. abstract class ClassificationTask extends AnyRef

    A ClassificationTask specifies a particular classification task for which we want to collect feature vectors and train a classifier.

    A ClassificationTask specifies a particular classification task for which we want to collect feature vectors and train a classifier.

    In practice, feature vectors will be tagged with their ClassificationTask, allowing us to easily sort a mixed set of feature vectors according to their relevant ClassificationTask, before training the respective classifiers.

  2. case class ClassifierBasedCostFunction(taskIdentifier: TaskIdentifier, transitionSystem: TransitionSystem, transitions: IndexedSeq[StateTransition], taskClassifierList: List[(ClassificationTask, TransitionClassifier)], featureNames: List[FeatureName], baseCostFunction: Option[StateCostFunction] = None) extends StateCostFunction with Product with Serializable

  3. class DTCostFunctionTrainer extends StateCostFunctionTrainer

    The DTCostFunctionTrainer uses the our in-house decision tree implementation (org.allenai.nlpstack.parse.poly.decisiontree) to train a StateCostFunction.

    The DTCostFunctionTrainer uses the our in-house decision tree implementation (org.allenai.nlpstack.parse.poly.decisiontree) to train a StateCostFunction. Training is triggered during construction, after which the .costFunction field contains the trained StateCostFunction.

  4. case class EmbeddedClassifier(classifier: ProbabilisticClassifier, transitions: IndexedSeq[StateTransition], featureNameMap: Seq[(Int, FeatureName)], numFeatures: Int) extends TransitionClassifier with Product with Serializable

    An EmbeddedClassifier wraps a org.allenai.nlpstack.parse.poly.decisiontree.ProbabilisticClassifier implementation to provide a classifier interface that maps Transitions to probabilities.

    An EmbeddedClassifier wraps a org.allenai.nlpstack.parse.poly.decisiontree.ProbabilisticClassifier implementation to provide a classifier interface that maps Transitions to probabilities.

    classifier

    the underlying classifier

    transitions

    the possible outcomes of the underlying classifier

    featureNameMap

    a list of the feature indices followed by their names

    numFeatures

    the number of features in the underlying classifier

  5. case class FSMTrainingVector(task: ClassificationTask, transition: StateTransition, feature: StateFeature, state: State) extends Product with Serializable

    A TrainingVector is a triple of the form (task, featureVector, transition), where task is the ClassificationTask associated with the feature vector (featureVector), and transition is the correct classification of the feature vector.

    A TrainingVector is a triple of the form (task, featureVector, transition), where task is the ClassificationTask associated with the feature vector (featureVector), and transition is the correct classification of the feature vector.

    These labeled feature vectors are used to train classifiers.

  6. abstract class FSMTrainingVectorSource extends AnyRef

  7. case class FeatureUnion(features: Iterable[StateFeature]) extends StateFeature with Product with Serializable

    A FeatureUnion simply merges the output of a list of features.

    A FeatureUnion simply merges the output of a list of features.

    features

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

  8. class GreedySearch extends Search

  9. case class InMemoryStateSource(states: Iterable[State]) extends StateSource with Product with Serializable

    A StateSource that keeps all its states in memory.

  10. trait MarbleBlock extends AnyRef

    A MarbleBlock is an unstructured input corresponding to a start state of a finite-state machine.

    A MarbleBlock is an unstructured input corresponding to a start state of a finite-state machine. The goal of the finite-state machine is to find a final state (which correponds to a Sculpture, i.e. a structured output).

    As an example, consider a transition-based parser. A MarbleBlock would be a sentence to be parsed, whereas a Sculpture would be a parse tree for that sentence.

  11. case class NbestCorpus(nbestLists: Iterable[NbestList]) extends Product with Serializable

    A sequence of NbestLists.

  12. case class NbestList(scoredSculptures: Iterable[(Sculpture, Double)]) extends Product with Serializable

    A sequence of (scored) sculptures.

  13. class NbestSearch extends AnyRef

    Finds the best n greedy paths through a finite-state machine.

  14. class NostalgicSearch extends AnyRef

    Like the GreedyTransitionParser, except that it remembers promising transitions that were not taken from the greedy (one-best) walk and returns those to the user.

  15. class Reranker extends AnyRef

    Chooses the lowest cost parse from an n-best list (according to the reranking function).

  16. abstract class RerankingFunction extends (Sculpture, Double) ⇒ Double

    A cost function for a pre-scored parse.

  17. case class ScoredWalk(walk: Walk, score: Double) extends Product with Serializable

    A ScoredWalk attaches a score to a Walk.

    A ScoredWalk attaches a score to a Walk.

    walk

    the unscored Walk

    score

    the floating-point score

  18. trait Sculpture extends AnyRef

    A Sculpture is a structured output corresponding to a final state of a finite-state machine, whose goal is to transform an unstructured input (a MarbleBlock) into a structured output.

    A Sculpture is a structured output corresponding to a final state of a finite-state machine, whose goal is to transform an unstructured input (a MarbleBlock) into a structured output.

    As an example, consider a transition-based parser. A MarbleBlock would be a sentence to be parsed, whereas a Sculpture would be a parse tree for that sentence.

  19. abstract class SculptureCost extends (Sculpture) ⇒ Double

  20. abstract class SculptureFeature extends (Sculpture) ⇒ FeatureVector

    A SculptureFeature computes a feature vector corresponding to a given sculpture.

  21. trait Search extends AnyRef

  22. trait State extends AnyRef

    A state of a finite-state machine.

  23. trait StateCost extends (Option[State]) ⇒ Double

    A StateCost maps a state to a cost.

  24. abstract class StateCostFunction extends (State) ⇒ Map[StateTransition, Double]

    A StateCostFunction assigns a (real-valued) cost to the Transitions that can potentially be applied to a State.

    A StateCostFunction assigns a (real-valued) cost to the Transitions that can potentially be applied to a State. Generally speaking: the lower the cost, the better the transition.

    Typically, instances of StateCostFunction will compute this cost using a feature representation of the State. But this is not always the case -- see the GuidedCostFunction in org.allenai.nlpstack.parse.poly.polyparser.ArcEagerGuidedCostFunction for a cost function that uses a gold parse tree as the basis for its cost function.

  25. abstract class StateCostFunctionTrainer extends AnyRef

    A StateCostFunctionTrainer trains a StateCostFunction from data.

    A StateCostFunctionTrainer trains a StateCostFunction from data. Training is triggered during construction, after which the .costFunction field contains the trained TransitionCostFunctionAndClassifier.

  26. abstract class StateFeature extends (State) ⇒ FeatureVector

    A StateFeature computes a feature vector corresponding to a given parser state.

  27. trait StateSource extends AnyRef

  28. abstract class StateTransition extends (Option[State]) ⇒ Option[State]

  29. case class TaskConjunction(tasks: Seq[ClassificationTask]) extends ClassificationTask with Product with Serializable

    The TaskConjunction is a conjunction of ClassificationTasks.

    The TaskConjunction is a conjunction of ClassificationTasks.

    tasks

    the tasks we want to conjoin

  30. case class TaskConjunctionIdentifier(taskIdentifiers: List[TaskIdentifier], activeTaskConjuncts: Option[Set[ClassificationTask]]) extends TaskIdentifier with Product with Serializable

    The TaskConjunctionIdentifier allows you to create a TaskIdentifier by conjoining existing TaskIdentifiers.

    The TaskConjunctionIdentifier allows you to create a TaskIdentifier by conjoining existing TaskIdentifiers. You will want to do this if you want to partition feature vectors according to multiple criteria at once.

    taskIdentifiers

    the task identifiers you want to conjoin

  31. trait TaskIdentifier extends (State) ⇒ Option[ClassificationTask]

    A TaskIdentifier identifies the ClassificationTask required to determine the next transition from a given parser state.

  32. case class TaskTree(baseIdentifier: Option[TaskIdentifier], children: List[(ClassificationTask, TaskTree)]) extends Product with Serializable

    A TaskTree can be viewed as a tree-structured TaskConjunctionIdentifier.

    A TaskTree can be viewed as a tree-structured TaskConjunctionIdentifier. Recall that a TaskConjunctionIdentifier associates every TransitionParserState with a TaskConjunction.

    To do this, each TaskTree is associated with an optional TaskIdentifier ident. If this is None, then it will associate every state with the trivial TaskConjunction (i.e. TaskConjunction(List())). Otherwise, it will compute the ClassificationTask returned by applying the TaskIdentifier to the state. If this task is not contained in its children map, then it will associate the state with TaskConjunction(List(ident)). Otherwise it will recursively call the child TaskTree on the state, and accumulate a TaskConjunction.

    TODO: remove this code once all dependent models are gone

    baseIdentifier

    the (optional) TaskIdentifier associated with this tree

    children

    a mapping from ClassificationTasks (in the range of baseIdentifier) to TaskTrees

  33. case class TaskTreeIdentifier(taskTree: TaskTree) extends TaskIdentifier with Product with Serializable

    This is a wrapper for TaskTree that implements the TaskIdentifier interface.

    This is a wrapper for TaskTree that implements the TaskIdentifier interface.

    It exists mainly for ease of serialization. See the TaskTree documentation for more details on its functionality.

    taskTree

    the task tree that drives this TaskIdentifier

  34. abstract class TransitionClassifier extends AnyRef

    A TransitionClassifier maps Transitions to probabilities.

  35. trait TransitionConstraint extends AnyRef

    A TransitionConstraint returns true if a given transition is illegal to apply in a given state.

  36. trait TransitionSystem extends AnyRef

  37. case class Walk(initialState: State, steps: Seq[WalkStep]) extends Product with Serializable

    A Walk is a walk through a finite-state machine.

    A Walk is a walk through a finite-state machine.

    initialState

    the state in which we begin

    steps

    the sequence of steps we take from the initial state

  38. case class WalkStep(state: State, transition: StateTransition) extends Product with Serializable

    A WalkStep is a single step in an FSM walk.

    A WalkStep is a single step in an FSM walk.

    state

    the current state

    transition

    the transition to take param transitionCosts the costs of the possible transitions in the current state

Value Members

  1. object BaseCostRerankingFunction extends RerankingFunction with Product with Serializable

  2. object ClassificationTask

  3. object FSMTrainingVectorSource

  4. object Fallback extends StateTransition with Product with Serializable

  5. object NbestCorpus extends Serializable

  6. object NbestList extends Serializable

  7. object NbestSearch

  8. object RerankingFunction

  9. object ScoredWalk extends Serializable

  10. object Sculpture

  11. object State

  12. object StateCostFunction

  13. object StateFeature

  14. object StateTransition

  15. object TaskConjunction extends Serializable

  16. object TaskConjunctionIdentifier extends Serializable

  17. object TaskIdentifier

  18. object TaskTree extends Serializable

  19. object TaskTreeIdentifier extends Serializable

  20. object TransitionClassifier

    Companion class for serializing TransitionClassifier instances.

  21. object TransitionConstraint

  22. object TransitionSystem

  23. object Walk extends Serializable

  24. object WalkStep extends Serializable

Ungrouped