Class AbstractEventTrainer<P extends opennlp.tools.util.Parameters>

java.lang.Object
opennlp.tools.ml.AbstractTrainer<P>
opennlp.tools.ml.AbstractEventTrainer<P>
All Implemented Interfaces:
opennlp.tools.commons.Trainer<P>, opennlp.tools.ml.EventTrainer<P>

public abstract class AbstractEventTrainer<P extends opennlp.tools.util.Parameters> extends AbstractTrainer<P> implements opennlp.tools.ml.EventTrainer<P>
A basic EventTrainer implementation.
  • Field Details

  • Constructor Details

    • AbstractEventTrainer

      public AbstractEventTrainer()
    • AbstractEventTrainer

      public AbstractEventTrainer(P parameters)
  • Method Details

    • validate

      public void validate()
      Description copied from class: AbstractTrainer
      Checks the configured parameters. If a subclass overrides this, it should call super.validate();.
      Overrides:
      validate in class AbstractTrainer<P extends opennlp.tools.util.Parameters>
    • isSortAndMerge

      public abstract boolean isSortAndMerge()
    • getDataIndexer

      public opennlp.tools.ml.model.DataIndexer<P> getDataIndexer(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> events) throws IOException
      Throws:
      IOException
    • doTrain

      public abstract opennlp.tools.ml.model.MaxentModel doTrain(opennlp.tools.ml.model.DataIndexer<P> indexer) throws IOException
      Throws:
      IOException
    • train

      public final opennlp.tools.ml.model.MaxentModel train(opennlp.tools.ml.model.DataIndexer<P> indexer) throws IOException
      Specified by:
      train in interface opennlp.tools.ml.EventTrainer<P extends opennlp.tools.util.Parameters>
      Throws:
      IOException
    • train

      public final opennlp.tools.ml.model.MaxentModel train(opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event> events) throws IOException
      Specified by:
      train in interface opennlp.tools.ml.EventTrainer<P extends opennlp.tools.util.Parameters>
      Throws:
      IOException