public abstract class AudioAnnotator extends IncrementalAnnotator<DoubleFV,String> implements FeatureExtractor<DoubleFV,SampleChunk>
DoubleFV
s and String labels. The
DoubleFV
s can be extracted from audio with this class also, as it
also implements FeatureExtractor interface for SampleChunk
s
(returning DoubleFV
s). However, there is no implementation for the
necessary FeatureExtractor.extractFeature(Object)
method, so
subclasses must implement this. The default annotator in use is a general
KNNAnnotator
for DoubleFV
s, however, this can be changed
using setAnnotator(AudioAnnotatorType)
.Modifier and Type | Class and Description |
---|---|
static class |
AudioAnnotator.AudioAnnotatorType
An enumeration that allows different trainers to be used and specified on
the command-line.
|
Constructor and Description |
---|
AudioAnnotator() |
Modifier and Type | Method and Description |
---|---|
List<ScoredAnnotation<String>> |
annotate(DoubleFV object)
Generate annotations for the given object.
|
Set<String> |
getAnnotations() |
AudioAnnotator.AudioAnnotatorType |
getAnnotator()
Get the annotator type in use.
|
void |
reset()
Reset the object to its initial condition, as if
it hasn't seen any training data.
|
void |
setAnnotator(AudioAnnotator.AudioAnnotatorType annotator)
Set the annotator type to use.
|
void |
train(Annotated<DoubleFV,String> annotated)
Train/update object using a new instance.
|
train, train, trainMultiClass
classify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
extractFeature
public AudioAnnotator()
public void train(Annotated<DoubleFV,String> annotated)
train
in interface IncrementalTrainer<Annotated<DoubleFV,String>>
annotated
- instance to train withIncrementalTrainer.train(java.lang.Object)
public void reset()
reset
in interface IncrementalTrainer<Annotated<DoubleFV,String>>
IncrementalTrainer.reset()
public Set<String> getAnnotations()
getAnnotations
in interface Annotator<DoubleFV,String>
Set
of all annotations this Annotator
knows
aboutAnnotator.getAnnotations()
public List<ScoredAnnotation<String>> annotate(DoubleFV object)
annotate
in interface Annotator<DoubleFV,String>
object
- the imageAnnotator.annotate(java.lang.Object)
public AudioAnnotator.AudioAnnotatorType getAnnotator()
public void setAnnotator(AudioAnnotator.AudioAnnotatorType annotator)
annotator
- The annotator type.