Uses of Class opennlp.tools.doccat.DocumentSample (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

## Uses of Class
opennlp.tools.doccat.DocumentSample

- Packages that use DocumentSample
  Package | Description
  --- | ---
  opennlp.tools.cmdline.doccat |
  opennlp.tools.doccat | Package for classifying a document into a category.
  opennlp.tools.formats | Experimental package related to converting various corpora to OpenNLP Format.

- - ### Uses of DocumentSample in opennlp.tools.cmdline.doccat

    Methods in opennlp.tools.cmdline.doccat with parameters of type DocumentSample
    Modifier and Type | Method and Description
    --- | ---
    `void` | DoccatFineGrainedReportListener.`correctlyClassified(DocumentSample reference, DocumentSample prediction)`
    `void` | DoccatEvaluationErrorListener.`missclassified(DocumentSample reference, DocumentSample prediction)`
    `void` | DoccatFineGrainedReportListener.`missclassified(DocumentSample reference, DocumentSample prediction)`

  - ### Uses of DocumentSample in opennlp.tools.doccat

    Methods in opennlp.tools.doccat that return DocumentSample
    Modifier and Type | Method and Description
    --- | ---
    `DocumentSample` | DocumentCategorizerEvaluator.`processSample(DocumentSample sample)` Evaluates the given reference `DocumentSample` object.
    `DocumentSample` | DocumentSampleStream.`read()`

    Methods in opennlp.tools.doccat with parameters of type DocumentSample
    Modifier and Type | Method and Description
    --- | ---
    `protected Iterator<Event>` | DocumentCategorizerEventStream.`createEvents(DocumentSample sample)`
    `DocumentSample` | DocumentCategorizerEvaluator.`processSample(DocumentSample sample)` Evaluates the given reference `DocumentSample` object.

    Method parameters in opennlp.tools.doccat with type arguments of type DocumentSample
    Modifier and Type | Method and Description
    --- | ---
    `void` | DoccatCrossValidator.`evaluate(ObjectStream<DocumentSample> samples, int nFolds)` Starts the evaluation.
    `static DoccatModel` | DocumentCategorizerME.`train(String languageCode, ObjectStream<DocumentSample> samples, TrainingParameters mlParams, DoccatFactory factory)`

    Constructor parameters in opennlp.tools.doccat with type arguments of type DocumentSample
    Constructor and Description
    `DocumentCategorizerEventStream(ObjectStream<DocumentSample> samples)` Initializes the current instance.
    `DocumentCategorizerEventStream(ObjectStream<DocumentSample> data, FeatureGenerator... featureGenerators)` Initializes the current instance via samples and feature generators.

  - ### Uses of DocumentSample in opennlp.tools.formats

    Methods in opennlp.tools.formats that return DocumentSample
    Modifier and Type | Method and Description
    --- | ---
    `DocumentSample` | TwentyNewsgroupSampleStream.`read()`

    Methods in opennlp.tools.formats that return types with arguments of type DocumentSample
    Modifier and Type | Method and Description
    --- | ---
    `ObjectStream<DocumentSample>` | DocumentSampleStreamFactory.`create(String[] args)`
    `ObjectStream<DocumentSample>` | TwentyNewsgroupSampleStreamFactory.`create(String[] args)`

Copyright © 2026 The Apache Software Foundation. All rights reserved.