/** * Constructor for the trainer tool * @param options the options to use. * @throws FileNotFoundException */ public SpeechDetectorTrainer( final Options options ) throws FileNotFoundException { this.options = options; // Create the trainer final IncrementalTrainer<Annotated<DoubleFV, String>> t = options.trainer.getAnnotator(); // Add the speech data to the space this.processDirectory( options.speechDir, true, t, options.limitNumber ); // Add the non-speech stuff to the space if( options.nonSpeechDir != null ) this.processDirectory( options.nonSpeechDir, false, t, options.limitNumber ); // Write the classifier to a file try { IOUtils.write( t, new DataOutputStream( new FileOutputStream( options.outputFile ) ) ); } catch( final IOException e ) { e.printStackTrace(); } }
/** * Constructor for the trainer tool * @param options the options to use. * @throws FileNotFoundException */ public SpeechDetectorTrainer( final Options options ) throws FileNotFoundException { this.options = options; // Create the trainer final IncrementalTrainer<Annotated<DoubleFV, String>> t = options.trainer.getAnnotator(); // Add the speech data to the space this.processDirectory( options.speechDir, true, t, options.limitNumber ); // Add the non-speech stuff to the space if( options.nonSpeechDir != null ) this.processDirectory( options.nonSpeechDir, false, t, options.limitNumber ); // Write the classifier to a file try { IOUtils.write( t, new DataOutputStream( new FileOutputStream( options.outputFile ) ) ); } catch( final IOException e ) { e.printStackTrace(); } }
/** * {@inheritDoc} * * @see org.openimaj.ml.annotation.Annotator#getAnnotations() */ @Override public Set<String> getAnnotations() { return this.getAnnotator().getAnnotator().getAnnotations(); }
/** * {@inheritDoc} * * @see org.openimaj.ml.training.IncrementalTrainer#reset() */ @Override public void reset() { this.getAnnotator().getAnnotator().reset(); }
/** * {@inheritDoc} * * @see org.openimaj.ml.training.IncrementalTrainer#train(java.lang.Object) */ @Override public void train(final Annotated<DoubleFV, String> annotated) { this.getAnnotator().getAnnotator().train(annotated); }
/** * {@inheritDoc} * * @see org.openimaj.ml.training.IncrementalTrainer#train(java.lang.Object) */ @Override public void train(final Annotated<DoubleFV, String> annotated) { this.getAnnotator().getAnnotator().train(annotated); }
/** * {@inheritDoc} * * @see org.openimaj.ml.training.IncrementalTrainer#reset() */ @Override public void reset() { this.getAnnotator().getAnnotator().reset(); }
/** * {@inheritDoc} * * @see org.openimaj.ml.annotation.Annotator#annotate(java.lang.Object) */ @Override public List<ScoredAnnotation<String>> annotate(final DoubleFV object) { return this.getAnnotator().getAnnotator().annotate(object); }
/** * {@inheritDoc} * * @see org.openimaj.ml.annotation.Annotator#getAnnotations() */ @Override public Set<String> getAnnotations() { return this.getAnnotator().getAnnotator().getAnnotations(); }
/** * {@inheritDoc} * * @see org.openimaj.ml.annotation.Annotator#annotate(java.lang.Object) */ @Override public List<ScoredAnnotation<String>> annotate(final DoubleFV object) { return this.getAnnotator().getAnnotator().annotate(object); }