Package opennlp.tools.sentdetect

Examples of opennlp.tools.sentdetect.SentenceDetectorEvaluator


    SentenceDetectorEvaluationMonitor errorListener = null;
    if (params.getMisclassified()) {
      errorListener = new SentenceEvaluationErrorListener();
    }
   
    SentenceDetectorEvaluator evaluator = new SentenceDetectorEvaluator(
        new SentenceDetectorME(model), errorListener);
   
    System.out.print("Evaluating ... ");
      ObjectStream<SentenceSample> sampleStream = SentenceDetectorTrainerTool.openSampleData("Test",
          trainingDataInFile, encoding);
     
      try {
      evaluator.evaluate(sampleStream);
      }
      catch (IOException e) {
        CmdLineUtil.printTrainingIoError(e);
        throw new TerminateToolException(-1);
      }
      finally {
        try {
          sampleStream.close();
        } catch (IOException e) {
          // sorry that this can fail
        }
      }
     
      System.err.println("done");
     
      System.out.println();
     
      System.out.println(evaluator.getFMeasure());
  }
View Full Code Here


    SentenceDetectorEvaluationMonitor errorListener = null;
    if (params.getMisclassified()) {
      errorListener = new SentenceEvaluationErrorListener();
    }
   
    SentenceDetectorEvaluator evaluator = new SentenceDetectorEvaluator(
        new SentenceDetectorME(model), errorListener);

    System.out.print("Evaluating ... ");
    try {
    evaluator.evaluate(sampleStream);
    }
    catch (IOException e) {
      throw new TerminateToolException(-1, "IO error while reading training data or indexing data: " +
          e.getMessage(), e);
    }
    finally {
      try {
        sampleStream.close();
      } catch (IOException e) {
        // sorry that this can fail
      }
    }

    System.err.println("done");

    System.out.println();

    System.out.println(evaluator.getFMeasure());
  }
View Full Code Here

    SentenceDetectorEvaluationMonitor errorListener = null;
    if (params.getMisclassified()) {
      errorListener = new SentenceEvaluationErrorListener();
    }

    SentenceDetectorEvaluator evaluator = new SentenceDetectorEvaluator(
        new SentenceDetectorME(model), errorListener);

    System.out.print("Evaluating ... ");
    try {
    evaluator.evaluate(sampleStream);
    }
    catch (IOException e) {
      throw new TerminateToolException(-1, "IO error while reading training data or indexing data: " +
          e.getMessage(), e);
    }
    finally {
      try {
        sampleStream.close();
      } catch (IOException e) {
        // sorry that this can fail
      }
    }

    System.err.println("done");

    System.out.println();

    System.out.println(evaluator.getFMeasure());
  }
View Full Code Here

TOP

Related Classes of opennlp.tools.sentdetect.SentenceDetectorEvaluator

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.