Package opennlp.tools.doccat

Examples of opennlp.tools.doccat.DoccatModel


  public void collectionProcessComplete(ProcessTrace trace)
      throws ResourceProcessException, IOException {

    GIS.PRINT_MESSAGES = false;

    DoccatModel categoryModel = DocumentCategorizerME.train(language, ObjectStreamUtils.createObjectStream(documentSamples));

    File modelFile = new File(getUimaContextAdmin().getResourceManager()
        .getDataPath() + File.separatorChar + mModelName);

    OpennlpUtil.serialize(categoryModel, modelFile);
View Full Code Here


    if (mLogger.isLoggable(Level.INFO)) {
      mLogger.log(Level.INFO, "Initializing the OpenNLP Categorizer.");
    }

    DoccatModel model;

    try {
      DoccatModelResource modelResource = (DoccatModelResource) context
          .getResourceObject(UimaUtil.MODEL_PARAMETER);
View Full Code Here

    return model;
  }

  @Override
  protected DoccatModel loadModel(InputStream in) throws IOException {
    return new DoccatModel(in);
  }
View Full Code Here

    CmdLineUtil.checkOutputFile("document categorizer model", modelOutFile);
    ObjectStream<DocumentSample> sampleStream =
        openSampleData("Training", trainingDataInFile, parameters.getEncoding());
   
    DoccatModel model;
    try {
      model = DocumentCategorizerME.train(parameters.getLanguage(), sampleStream,
          parameters.getCutoff(), parameters.getNumberOfIterations());
    } catch (IOException e) {
      CmdLineUtil.printTrainingIoError(e);
View Full Code Here

TOP

Related Classes of opennlp.tools.doccat.DoccatModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.