Package opennlp.tools.ml.perceptron
Klasse SimplePerceptronSequenceTrainer
java.lang.Object
opennlp.tools.ml.AbstractTrainer
opennlp.tools.ml.AbstractEventModelSequenceTrainer
opennlp.tools.ml.perceptron.SimplePerceptronSequenceTrainer
- Alle implementierten Schnittstellen:
Trainer,EventModelSequenceTrainer<Event>
Trains
models with sequences using the perceptron algorithm.
Each outcome is represented as a binary perceptron classifier. This supports standard (integer) weighting as well average weighting.
Sequence information is used in a simplified was to that described in: Discriminative Training Methods for Hidden Markov Models: Theory and Experiments with the Perceptron Algorithm. Michael Collins, EMNLP 2002.
Specifically only updates are applied to tokens which were incorrectly tagged by a sequence tagger rather than to all feature across the sequence which differ from the training sequence.
- Siehe auch:
-
Feldübersicht
FelderVon Schnittstelle geerbte Felder opennlp.tools.ml.EventModelSequenceTrainer
SEQUENCE_VALUE -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungInstantiates aSimplePerceptronSequenceTrainerwith a default configuration of training parameters. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdoTrain(SequenceStream<Event> events) voidnextIteration(int iteration) trainModel(int iterations, SequenceStream<Event> sequenceStream, int cutoff, boolean useAverage) Trains aPerceptronModelwith given parameters.voidvalidate()Checks the configuredparameters.Von Klasse geerbte Methoden opennlp.tools.ml.AbstractEventModelSequenceTrainer
trainVon Klasse geerbte Methoden opennlp.tools.ml.AbstractTrainer
getAlgorithm, getCutoff, getIterations, init
-
Felddetails
-
PERCEPTRON_SEQUENCE_VALUE
- Siehe auch:
-
-
Konstruktordetails
-
SimplePerceptronSequenceTrainer
public SimplePerceptronSequenceTrainer()Instantiates aSimplePerceptronSequenceTrainerwith a default configuration of training parameters.
-
-
Methodendetails
-
validate
public void validate()Checks the configuredparameters. If a subclass overrides this, it should callsuper.validate();.- Setzt außer Kraft:
validatein KlasseAbstractTrainer- Löst aus:
IllegalArgumentException- Thrown if the algorithm name is not equal to {PERCEPTRON_SEQUENCE_VALUE}.
-
doTrain
- Angegeben von:
doTrainin KlasseAbstractEventModelSequenceTrainer- Löst aus:
IOException
-
trainModel
public AbstractModel trainModel(int iterations, SequenceStream<Event> sequenceStream, int cutoff, boolean useAverage) throws IOException Trains aPerceptronModelwith given parameters.- Parameter:
iterations- The number of iterations to use for training.sequenceStream- TheSequenceStream<Event>used as data input.cutoff- The {TrainingParameters.CUTOFF_PARAM} value to use for training.useAverage- Whether to use 'averaging', or not.- Gibt zurück:
- A valid, trained
perceptron model. - Löst aus:
IOException
-
nextIteration
- Löst aus:
IOException
-