Interface AnnotatorSequence<F,T extends Comparable<T>>

Type Parameters:
F - the feature type
T - the tag type

public interface AnnotatorSequence<F,T extends Comparable<T>>
A view-model describing a single sequence to present to a user for tagging.

The sequence carries a non-empty, immutable list of AnnotatorToken entries — one per token, each bundling the data the user-interface needs to render and edit that token.

Instances are constructed via one of the two factory methods on AnnotatorModels, chosen by whether a tagger is available: annotatorSequence(..., taggedSequence) for the with-tagger path, or annotatorSequence(..., tokens, tagProvider) for the no-tagger path.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns which display-feature sources this sequence carries, derived from which feature extractors were configured.
    Returns the conditional probability the model assigns to the given tagging of this sequence, or null when no model backs this sequence (the no-tagger path).
    int
    Returns the 1-based position of this sequence within the overall annotation batch.
    Returns the per-token entries for the sequence.
    int
    Returns the total number of sequences in the overall annotation batch.
  • Method Details

    • featureAvailability

      FeatureAvailability featureAvailability()
      Returns which display-feature sources this sequence carries, derived from which feature extractors were configured. Key availability backs the key-feature view and verbose availability backs the all-features view; when a source is unavailable, every token's corresponding feature set is empty and the user-interface offers no view for it.
      Returns:
      the feature availability
    • sequenceNumber

      int sequenceNumber()
      Returns the 1-based position of this sequence within the overall annotation batch.
      Returns:
      the sequence number
    • probabilityOf

      @Nullable Double probabilityOf(List<T> tags)
      Returns the conditional probability the model assigns to the given tagging of this sequence, or null when no model backs this sequence (the no-tagger path).

      When non-null, it is bound to this sequence's input and expects one tag per token; the terminal interface uses it to show a total likelihood that updates as the user revises tags.

      This method does not guarantee that a wrong-sized tags list is rejected; how such a mismatch is handled is left to the backing scorer.

      Parameters:
      tags - the candidate tag for each token, in token order; must have one entry per token
      Returns:
      the conditional probability of tags given the input in [0, 1], or null when no model backs this sequence
    • tokens

      List<AnnotatorToken<F,T>> tokens()
      Returns the per-token entries for the sequence.
      Returns:
      the tokens
    • totalSequences

      int totalSequences()
      Returns the total number of sequences in the overall annotation batch.
      Returns:
      the total number of sequences