Uses of Class
org.tribuo.sequence.SequenceExample
Package
Description
Provides infrastructure for
SequenceModel
s which
emit Label
s at each step of the sequence.Provides a classification sequence data generator for smoke testing implementations.
Provides an implementation of Viterbi for generating structured outputs, which can sit on top of any
Label
based classification model.Provides an implementation of a linear chain CRF trained using Stochastic Gradient Descent.
Provides feature extraction implementations which use ONNX models.
Provides an interface for working with TensorFlow sequence models, using Tribuo's
SequenceModel
abstraction.Provides core classes for working with sequences of
Example
s.-
Uses of SequenceExample in org.tribuo.classification.sequence
Modifier and TypeMethodDescriptionabstract <SUB extends ConfidencePredictingSequenceModel.Subsequence>
List<Double>ConfidencePredictingSequenceModel.scoreSubsequences
(SequenceExample<Label> example, List<Prediction<Label>> predictions, List<SUB> subsequences) The scoring function for the subsequences. -
Uses of SequenceExample in org.tribuo.classification.sequence.example
Modifier and TypeMethodDescriptionstatic SequenceExample<Label>
SequenceDataGenerator.generateEmptyExample()
This generates a sequence example with no examples.static SequenceExample<Label>
SequenceDataGenerator.generateGorillaA()
Generates a sequence example with a mixture of features and three labels "O", "Status" and "Monkey".static SequenceExample<Label>
SequenceDataGenerator.generateGorillaB()
Generates a sequence example with a mixture of features and three labels "O", "Status" and "Monkey".static SequenceExample<Label>
SequenceDataGenerator.generateInvalidExample()
This generates a sequence example with features that are unused by the training data.static SequenceExample<Label>
SequenceDataGenerator.generateOtherInvalidExample()
This generates a sequence example where the first example has no features. -
Uses of SequenceExample in org.tribuo.classification.sequence.viterbi
-
Uses of SequenceExample in org.tribuo.classification.sgd.crf
Modifier and TypeMethodDescriptionstatic com.oracle.labs.mlrg.olcut.util.Pair<int[],
SparseVector[]> CRFModel.convert
(SequenceExample<Label> example, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Label> labelIDMap) Deprecated.static <T extends Output<T>>
SparseVector[]CRFModel.convert
(SequenceExample<T> example, ImmutableFeatureMap featureIDMap) Deprecated.As it's replaced withCRFModel.convertToVector(org.tribuo.sequence.SequenceExample<T>, org.tribuo.ImmutableFeatureMap)
which is more flexible.static com.oracle.labs.mlrg.olcut.util.Pair<int[],
SGDVector[]> CRFModel.convertToVector
(SequenceExample<Label> example, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Label> labelIDMap) Converts aSequenceExample
into an array ofSGDVector
s and labels suitable for CRF prediction.CRFModel.convertToVector
(SequenceExample<T> example, ImmutableFeatureMap featureIDMap) Converts aSequenceExample
into an array ofSGDVector
s suitable for CRF prediction.CRFModel.predict
(SequenceExample<Label> example) CRFModel.scoreChunks
(SequenceExample<Label> example, List<Chunk> chunks) Scores the chunks using constrained belief propagation.<SUB extends ConfidencePredictingSequenceModel.Subsequence>
List<Double>CRFModel.scoreSubsequences
(SequenceExample<Label> example, List<Prediction<Label>> predictions, List<SUB> subsequences) -
Uses of SequenceExample in org.tribuo.interop.onnx.extractors
Modifier and TypeMethodDescriptionBERTFeatureExtractor.extractSequenceExample
(List<String> tokens, boolean stripSentenceMarkers) Passes the tokens through BERT, replacing any unknown tokens with the [UNK] token.BERTFeatureExtractor.extractSequenceExample
(List<String> tokens, List<T> output, boolean stripSentenceMarkers) Passes the tokens through BERT, replacing any unknown tokens with the [UNK] token. -
Uses of SequenceExample in org.tribuo.interop.tensorflow.sequence
Modifier and TypeMethodDescriptionList<Prediction<T>>
SequenceOutputConverter.decode
(org.tensorflow.Tensor output, SequenceExample<T> input, ImmutableOutputInfo<T> labelMap) Decode a tensor of graph output into a list of predictions for the input sequence.SequenceFeatureConverter.encode
(SequenceExample<?> example, ImmutableFeatureMap featureMap) Encodes an example as a feed dict.SequenceOutputConverter.encode
(SequenceExample<T> example, ImmutableOutputInfo<T> labelMap) Encodes an example's label as a feed dict.List<Prediction<T>>
TensorFlowSequenceModel.predict
(SequenceExample<T> example) Modifier and TypeMethodDescriptionList<List<Prediction<T>>>
SequenceOutputConverter.decode
(org.tensorflow.Tensor outputs, List<SequenceExample<T>> inputBatch, ImmutableOutputInfo<T> labelMap) Decode graph output tensors corresponding to a batch of input sequences.SequenceFeatureConverter.encode
(List<? extends SequenceExample<?>> batch, ImmutableFeatureMap featureMap) Encodes a batch of examples as a feed dict.SequenceOutputConverter.encode
(List<SequenceExample<T>> batch, ImmutableOutputInfo<T> labelMap) Encodes a batch of labels as a feed dict. -
Uses of SequenceExample in org.tribuo.sequence
Modifier and TypeFieldDescriptionprotected final List<SequenceExample<T>>
SequenceDataset.data
The data in this data set.Modifier and TypeMethodDescriptionSequenceExample.copy()
Returns a deep copy of this SequenceExample.static <T extends Output<T>>
SequenceExample<T>SequenceExample.createWithEmptyOutputs
(List<? extends List<? extends Feature>> features, OutputFactory<T> outputFactory) Creates a SequenceExample usingOutputFactory.getUnknownOutput()
as the output for each sequence element.static SequenceExample<?>
SequenceExample.deserialize
(org.tribuo.protos.core.SequenceExampleProto e) Deserialization shortcut, used to firm up the types.static SequenceExample<?>
SequenceExample.deserializeFromProto
(int version, String className, com.google.protobuf.Any message) Deserialization factory.SequenceDataset.getExample
(int index) Gets the example at the specified index, or throws IllegalArgumentException if the index is out of bounds.Modifier and TypeMethodDescriptionprotected static List<SequenceExample<?>>
SequenceDataset.deserializeExamples
(List<org.tribuo.protos.core.SequenceExampleProto> examplesList, Class<?> outputClass, FeatureMap fmap) Deserializes a list of sequence example protos into a list of sequence examples.SequenceDataset.getData()
Returns an unmodifiable view on the data.SequenceDataset.iterator()
Modifier and TypeMethodDescriptionprotected void
ImmutableSequenceDataset.add
(SequenceExample<T> ex) Adds aSequenceExample
to the dataset, which will insert feature ids, remove unknown features and sort the examples by the feature ids.protected void
ImmutableSequenceDataset.add
(SequenceExample<T> ex, Merger merger) Adds aSequenceExample
to the dataset, which will insert feature ids, remove unknown features and sort the examples by the feature ids.void
MutableSequenceDataset.add
(SequenceExample<T> ex) Adds aSequenceExample
to this dataset.List<Prediction<T>>
IndependentSequenceModel.predict
(SequenceExample<T> example) abstract List<Prediction<T>>
SequenceModel.predict
(SequenceExample<T> example) Uses the model to predict the output for a single example.Modifier and TypeMethodDescriptionvoid
MutableSequenceDataset.addAll
(Collection<SequenceExample<T>> collection) Adds all the SequenceExamples in the supplied collection to this dataset.List<List<Prediction<T>>>
SequenceModel.predict
(Iterable<SequenceExample<T>> examples) Uses the model to predict the output for multiple examples.ModifierConstructorDescriptionSequenceExample
(SequenceExample<T> other) Creates a deep copy of the supplied sequence example.ModifierConstructorDescriptionImmutableSequenceDataset
(Iterable<SequenceExample<T>> dataSource, DataProvenance sourceProvenance, FeatureMap featureIDMap, OutputInfo<T> outputIDInfo, OutputFactory<T> outputFactory) Creates a dataset from a data source.ImmutableSequenceDataset
(Iterable<SequenceExample<T>> dataSource, DataProvenance sourceProvenance, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, OutputFactory<T> outputFactory) Creates a dataset from a data source.protected
ImmutableSequenceDataset
(DataProvenance provenance, OutputFactory<T> factory, String tribuoVersion, ImmutableFeatureMap fmap, ImmutableOutputInfo<T> outputInfo, List<SequenceExample<T>> examples) Deserialization constructor.MutableSequenceDataset
(Iterable<SequenceExample<T>> dataSource, DataProvenance sourceProvenance, OutputFactory<T> outputFactory) Creates a dataset from a data source.
CRFModel.convertToVector(org.tribuo.sequence.SequenceExample<T>, org.tribuo.ImmutableFeatureMap)
which is more flexible.