Class ConfidencePredictingSequenceModel

java.lang.Object
org.tribuo.sequence.SequenceModel<Label>
org.tribuo.classification.sequence.ConfidencePredictingSequenceModel
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<ModelProvenance>, Serializable
Direct Known Subclasses:
CRFModel

public abstract class ConfidencePredictingSequenceModel extends SequenceModel<Label>
A Sequence model which can provide confidence predictions for subsequence predictions.

Used to provide confidence scores on a per subsequence level.

The exemplar of this is providing a confidence score for each Named Entity present in a SequenceExample.

See Also:
  • Constructor Details

    • ConfidencePredictingSequenceModel

      protected ConfidencePredictingSequenceModel(String name, ModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Label> labelIDMap)
      Constructs a ConfidencePredictingSequenceModel with the supplied parameters.
      Parameters:
      name - The model name.
      description - The model provenance.
      featureIDMap - The feature domain.
      labelIDMap - The output domain.
  • Method Details

    • scoreSubsequences

      public abstract <SUB extends ConfidencePredictingSequenceModel.Subsequence> List<Double> scoreSubsequences(SequenceExample<Label> example, List<Prediction<Label>> predictions, List<SUB> subsequences)
      The scoring function for the subsequences. Provides the scores which should be assigned to each subsequence.
      Type Parameters:
      SUB - The subsequence type.
      Parameters:
      example - The input sequence example.
      predictions - The predictions produced by this model.
      subsequences - The subsequences to score.
      Returns:
      The scores for the subsequences.
    • multiplyWeights

      public static <SUB extends ConfidencePredictingSequenceModel.Subsequence> List<Double> multiplyWeights(List<Prediction<Label>> predictions, List<SUB> subsequences)
      A scoring method which multiplies together the per prediction scores.
      Type Parameters:
      SUB - The subsequence type.
      Parameters:
      predictions - The element level predictions.
      subsequences - The subsequences denoting prediction boundaries.
      Returns:
      A list of scores for each subsequence.