OBJECT
- Type of object being annotatedANNOTATION
- Type of annotationpublic class NaiveBayesAnnotator<OBJECT,ANNOTATION> extends IncrementalAnnotator<OBJECT,ANNOTATION>
VectorNaiveBayesCategorizer
as the actual classifier.Modifier and Type | Class and Description |
---|---|
static class |
NaiveBayesAnnotator.Mode
Modes of operation for prediction using the
NaiveBayesAnnotator . |
Constructor and Description |
---|
NaiveBayesAnnotator(FeatureExtractor<? extends FeatureVector,OBJECT> extractor,
NaiveBayesAnnotator.Mode mode)
Construct a
NaiveBayesAnnotator with the given feature extractor
and mode of operation. |
Modifier and Type | Method and Description |
---|---|
List<ScoredAnnotation<ANNOTATION>> |
annotate(OBJECT object)
Generate annotations for the given object.
|
static <OBJECT extends FeatureVector,ANNOTATION> |
create(NaiveBayesAnnotator.Mode mode)
Convenience method to construct a
NaiveBayesAnnotator in the case
where the raw objects are themselves the feature and thus an
IdentityFeatureExtractor can be used. |
Set<ANNOTATION> |
getAnnotations() |
void |
reset()
Reset the object to its initial condition, as if
it hasn't seen any training data.
|
void |
train(Annotated<OBJECT,ANNOTATION> annotated)
Train/update object using a new instance.
|
train, train, trainMultiClass
classify
public NaiveBayesAnnotator(FeatureExtractor<? extends FeatureVector,OBJECT> extractor, NaiveBayesAnnotator.Mode mode)
NaiveBayesAnnotator
with the given feature extractor
and mode of operation.extractor
- the feature extractor.mode
- the mode of operation during predictionpublic static <OBJECT extends FeatureVector,ANNOTATION> NaiveBayesAnnotator<OBJECT,ANNOTATION> create(NaiveBayesAnnotator.Mode mode)
NaiveBayesAnnotator
in the case
where the raw objects are themselves the feature and thus an
IdentityFeatureExtractor
can be used. This method is equivalent
to calling
new NaiveBayesAnnotator
.mode
- the mode of operation during predictionNaiveBayesAnnotator
public void train(Annotated<OBJECT,ANNOTATION> annotated)
IncrementalTrainer
annotated
- instance to train withpublic void reset()
IncrementalTrainer
public Set<ANNOTATION> getAnnotations()
public List<ScoredAnnotation<ANNOTATION>> annotate(OBJECT object)
Annotator
object
- the image