Interface AnnotatorSequence<F,T extends Comparable<T>>
- Type Parameters:
F- the feature typeT- the tag type
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 TypeMethodDescriptionReturns which display-feature sources this sequence carries, derived from which feature extractors were configured.probabilityOf(List<T> tags) Returns the conditional probability the model assigns to the given tagging of this sequence, ornullwhen no model backs this sequence (the no-tagger path).intReturns the 1-based position of this sequence within the overall annotation batch.List<AnnotatorToken<F, T>> tokens()Returns the per-token entries for the sequence.intReturns 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.Keyavailability backs the key-feature view andverboseavailability 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
Returns the conditional probability the model assigns to the given tagging of this sequence, ornullwhen 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
tagslist 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 pertoken- Returns:
- the conditional probability of
tagsgiven the input in[0, 1], ornullwhen 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
-