/// <summary> /// Evaluates the specified chunk samples. /// </summary> /// <param name="samples">The chunk samples to be evaluated.</param> /// <param name="partitions">The partitions (folds).</param> public void Evaluate(IObjectStream <ChunkSample> samples, int partitions) { var partitioner = new CrossValidationPartitioner <ChunkSample>(samples, partitions); while (partitioner.HasNext) { var trainingSampleStream = partitioner.Next(); var model = ChunkerME.Train(languageCode, trainingSampleStream, parameters, chunkerFactory); var evaluator = new ChunkerEvaluator(new ChunkerME(model), listeners); evaluator.Evaluate(trainingSampleStream.GetTestSampleStream()); FMeasure.MergeInto(evaluator.FMeasure); } }