Package opennlp.tools.util.eval
Klasse CrossValidationPartitioner.TrainingSampleStream<E>
java.lang.Object
opennlp.tools.util.eval.CrossValidationPartitioner.TrainingSampleStream<E>
- Typparameter:
E- The generic type of samples.
- Alle implementierten Schnittstellen:
AutoCloseable,ObjectStream<E>
- Umschließende Klasse:
CrossValidationPartitioner<E>
public static class CrossValidationPartitioner.TrainingSampleStream<E>
extends Object
implements ObjectStream<E>
The
CrossValidationPartitioner.TrainingSampleStream which iterates over
all training elements.
Note:
After the CrossValidationPartitioner.TestSampleStream was obtained
the CrossValidationPartitioner.TrainingSampleStream must not be used
anymore, otherwise a IllegalStateException
is thrown.
The streams must not be used anymore after the
CrossValidationPartitioner was moved to one of next partitions.
If they are called anyway an IllegalStateException is thrown.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclose()Closes theObjectStreamand releases all allocated resources.Retrieves theObjectStreamover the test/evaluations elements and poisons thisCrossValidationPartitioner.TrainingSampleStream.read()Returns the nextObjectStreamobject.voidreset()Resets the training sample.
-
Methodendetails
-
read
Beschreibung aus Schnittstelle kopiert:ObjectStreamReturns the nextObjectStreamobject. Calling this method repeatedly until it returnsnullwill return each object from the underlying source exactly once.- Angegeben von:
readin SchnittstelleObjectStream<E>- Gibt zurück:
- The next object or
nullto signal that the stream is exhausted. - Löst aus:
IOException- Thrown if there is an error during reading.
-
reset
Resets the training sample. Use this if you need to collect things before training, for example, to collect induced abbreviations or create a POS Dictionary.- Angegeben von:
resetin SchnittstelleObjectStream<E>- Löst aus:
IOException- Thrown if IO errors occurred.IllegalStateException- Thrown if a non-consistent state occurred.
-
close
Beschreibung aus Schnittstelle kopiert:ObjectStreamCloses theObjectStreamand releases all allocated resources. After close was called, it's not allowed to callObjectStream.read()orObjectStream.reset().- Angegeben von:
closein SchnittstelleAutoCloseable- Angegeben von:
closein SchnittstelleObjectStream<E>- Löst aus:
IOException- Thrown if there is an error during closing the stream.
-
getTestSampleStream
Retrieves theObjectStreamover the test/evaluations elements and poisons thisCrossValidationPartitioner.TrainingSampleStream. From now on calls to the hasNext and next methods are forbidden and will raise anIllegalArgumentException.- Gibt zurück:
- The test sample
stream. - Löst aus:
IOException
-