OBJECT - Type of objectANNOTATION - Type of annotationpublic abstract class IncrementalAnnotator<OBJECT,ANNOTATION> extends AbstractAnnotator<OBJECT,ANNOTATION> implements IncrementalTrainer<Annotated<OBJECT,ANNOTATION>>
Annotator that can be trained/updated incrementally.| Modifier | Constructor and Description |
|---|---|
protected |
IncrementalAnnotator() |
| Modifier and Type | Method and Description |
|---|---|
void |
train(GroupedDataset<ANNOTATION,? extends ListDataset<OBJECT>,OBJECT> dataset)
Train the annotator with the given grouped dataset.
|
void |
train(Iterable<? extends Annotated<OBJECT,ANNOTATION>> data)
Train the annotator with the given data.
|
void |
trainMultiClass(GroupedDataset<ANNOTATION,? extends ListDataset<OBJECT>,OBJECT> dataset)
Train the annotator with the given grouped dataset.
|
classifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreset, trainannotate, getAnnotationsprotected IncrementalAnnotator()
public void train(Iterable<? extends Annotated<OBJECT,ANNOTATION>> data)
IncrementalTrainer.train(Object) on each data item.
Subclasses may override to do something more intelligent if necessary.train in interface IncrementalTrainer<Annotated<OBJECT,ANNOTATION>>data - the training datapublic void trainMultiClass(GroupedDataset<ANNOTATION,? extends ListDataset<OBJECT>,OBJECT> dataset)
If your dataset contains multiple labels for each object (through an
object appearing in multiple groups) you should use
train(GroupedDataset).
dataset - the dataset to train onpublic void train(GroupedDataset<ANNOTATION,? extends ListDataset<OBJECT>,OBJECT> dataset)
If the dataset is actually multi-class (i.e. each object belongs to only
a single group), then calling this method is equivalent to calling
trainMultiClass(GroupedDataset), but is less efficient as the
dataset has to be converted into a list.
Some annotator implementations do not care whether the data is
multi-class or multi-label, and might choose to override this method to
just call trainMultiClass(GroupedDataset) instead.
dataset - the dataset to train on