Examples of PerformanceMonitor


Examples of opennlp.tools.cmdline.PerformanceMonitor

      TokenNameFinderEvaluator evaluator = new TokenNameFinderEvaluator(nameFinder);

      final NameSampleDataStream sampleStream = new NameSampleDataStream(
          new PlainTextByLineStream(new InputStreamReader(new FileInputStream(args[2]), args[1])));

      final PerformanceMonitor monitor = new PerformanceMonitor("sent");

      monitor.startAndPrintThroughput();

      ObjectStream<NameSample> iterator = new ObjectStream<NameSample>() {

        public NameSample read() throws IOException {
          monitor.incrementCounter();
          return sampleStream.read();
        }

        public void reset() throws IOException {
          sampleStream.reset();
        }

        public void close() throws IOException {
          sampleStream.close();
        }
      };

      evaluator.evaluate(iterator);

      monitor.stopAndPrintFinalResult();

      System.out.println();
      System.out.println("F-Measure: " + evaluator.getFMeasure().getFMeasure());
      System.out.println("Recall: " + evaluator.getFMeasure().getRecallScore());
      System.out.println("Precision: " + evaluator.getFMeasure().getPrecisionScore());
View Full Code Here

Examples of opennlp.tools.cmdline.PerformanceMonitor

    DocumentCategorizerEvaluator evaluator = new DocumentCategorizerEvaluator(
        new DocumentCategorizerME(model),
        listeners.toArray(new DoccatEvaluationMonitor[listeners.size()]));

    final PerformanceMonitor monitor = new PerformanceMonitor("doc");

    ObjectStream<DocumentSample> measuredSampleStream = new ObjectStream<DocumentSample>() {

      public DocumentSample read() throws IOException {
        monitor.incrementCounter();
        return sampleStream.read();
      }

      public void reset() throws IOException {
        sampleStream.reset();
      }

      public void close() throws IOException {
        sampleStream.close();
      }
    };

    monitor.startAndPrintThroughput();

    try {
      evaluator.evaluate(measuredSampleStream);
    } catch (IOException e) {
      System.err.println("failed");
      throw new TerminateToolException(-1, "IO error while reading test data: "
          + e.getMessage(), e);
    } finally {
      try {
        measuredSampleStream.close();
      } catch (IOException e) {
        // sorry that this can fail
      }
    }

    monitor.stopAndPrintFinalResult();

    System.out.println();

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

Examples of opennlp.tools.cmdline.PerformanceMonitor

          new DetokenizationDictionaryLoader().load(new File(args[0])));

      ObjectStream<String> tokenizedLineStream =
        new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());

      PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent");
      perfMon.start();


        String tokenizedLine;
        while ((tokenizedLine = tokenizedLineStream.read()) != null) {

          // white space tokenize line
          String tokens[] = WhitespaceTokenizer.INSTANCE.tokenize(tokenizedLine);

          System.out.println(detokenizer.detokenize(tokens, null));

          perfMon.incrementCounter();
        }
              perfMon.stopAndPrintFinalResult();
      }
      catch (IOException e) {
        CmdLineUtil.handleStdinIoError(e);
      }
View Full Code Here

Examples of org.eclipse.persistence.tools.profiler.PerformanceMonitor

            if (newProfilerClassName.equals(ProfilerType.PerformanceProfiler)) {
                session.setProfiler(new PerformanceProfiler());
                return;
            }
            if (newProfilerClassName.equals(ProfilerType.PerformanceMonitor)) {
                session.setProfiler(new PerformanceMonitor());
                return;
            }
           
            if (newProfilerClassName.equals(ProfilerType.DMSProfiler)) {
                newProfilerClassName = ProfilerType.DMSProfilerClassName;
View Full Code Here

Examples of org.eclipse.persistence.tools.profiler.PerformanceMonitor

            if (newProfilerClassName.equals(ProfilerType.PerformanceProfiler)) {
                session.setProfiler(new PerformanceProfiler());
                return;
            }
            if (newProfilerClassName.equals(ProfilerType.PerformanceMonitor)) {
                session.setProfiler(new PerformanceMonitor());
                return;
            }
           
            String originalProfilerClassNamer = null;
            if (session.getProfiler() != null) {
View Full Code Here

Examples of org.eclipse.persistence.tools.profiler.PerformanceMonitor

            if (newProfilerClassName.equals(ProfilerType.PerformanceProfiler)) {
                session.setProfiler(new PerformanceProfiler());
                return;
            }
            if (newProfilerClassName.equals(ProfilerType.PerformanceMonitor)) {
                session.setProfiler(new PerformanceMonitor());
                return;
            }
           
            String originalProfilerClassNamer = null;
            if (session.getProfiler() != null) {
View Full Code Here

Examples of org.eclipse.persistence.tools.profiler.PerformanceMonitor

            if (newProfilerClassName.equals(ProfilerType.PerformanceProfiler)) {
                session.setProfiler(new PerformanceProfiler());
                return;
            }
            if (newProfilerClassName.equals(ProfilerType.PerformanceMonitor)) {
                session.setProfiler(new PerformanceMonitor());
                return;
            }
           
            if (newProfilerClassName.equals(ProfilerType.DMSProfiler)) {
                newProfilerClassName = ProfilerType.DMSProfilerClassName;
View Full Code Here

Examples of org.eclipse.persistence.tools.profiler.PerformanceMonitor

            if (newProfilerClassName.equals(ProfilerType.PerformanceProfiler)) {
                session.setProfiler(new PerformanceProfiler());
                return;
            }
            if (newProfilerClassName.equals(ProfilerType.PerformanceMonitor)) {
                session.setProfiler(new PerformanceMonitor());
                return;
            }
           
            if (newProfilerClassName.equals(ProfilerType.DMSProfiler)) {
                newProfilerClassName = ProfilerType.DMSProfilerClassName;
View Full Code Here

Examples of org.eclipse.persistence.tools.profiler.PerformanceMonitor

            if (newProfilerClassName.equals(ProfilerType.PerformanceProfiler)) {
                session.setProfiler(new PerformanceProfiler());
                return;
            }
            if (newProfilerClassName.equals(ProfilerType.PerformanceMonitor)) {
                session.setProfiler(new PerformanceMonitor());
                return;
            }
           
            String originalProfilerClassNamer = null;
            if (session.getProfiler() != null) {
View Full Code Here

Examples of org.fishwife.jrugged.PerformanceMonitor

     * @param name the value for the {@link PerformanceMonitorBean}
     * @return the found {@link PerformanceMonitorBean}, or null if it is not
     * found.
     */
    public PerformanceMonitorBean findPerformanceMonitorBean(String name) {
        PerformanceMonitor performanceMonitor = findPerformanceMonitor(name);

        if (performanceMonitor instanceof PerformanceMonitorBean) {
            return (PerformanceMonitorBean)performanceMonitor;
        }
        return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.