Package opennlp.model

Examples of opennlp.model.EventStream


    }
    String dataFileName = new String(args[ai++]);
    String modelFileName = new String(args[ai]);
    try {
      FileReader datafr = new FileReader(new File(dataFileName));
      EventStream es;
      if (!real) {
        es = new BasicEventStream(new PlainTextByLineDataStream(datafr), ",");
      } else {
        es = new RealBasicEventStream(new PlainTextByLineDataStream(datafr));
      }
View Full Code Here


      }

      System.out.println("=== Predictions on test data ===\n");
      System.out.println(" inst#     actual  predicted error prediction");
      try {
        EventStream es = new BasicEventStream(new PlainTextByLineDataStream(
            new FileReader(new File(dataFileName))), ",");

        while (es.hasNext()) {
          predictor.eval(es.next(), real);
        }

        return;
      } catch (Exception e) {
        System.out.println("Unable to read from specified file: "
View Full Code Here

  public static final void main(String[] args) throws java.io.IOException {
    if (args.length != 0) {
      System.err.println("Usage: NameFinderEventStream < training files");
      System.exit(1);
    }
    EventStream es = new NameFinderEventStream(new NameSampleDataStream(new PlainTextByLineStream(new java.io.InputStreamReader(System.in))));
    while (es.hasNext()) {
      System.out.println(es.next());
    }
  }
View Full Code Here

TOP

Related Classes of opennlp.model.EventStream

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.