Package opennlp.maxent

Examples of opennlp.maxent.TwoPassDataIndexer


      List<Event> trainData = events.subList(0, events.size()/2);
      //trainData = new FeatureSelector().selectFeatures(trainData, 200.0);
      List<Event> testData = events.subList(events.size()/2, events.size());
     
      if(trainData.size() == 1) trainData.add(trainData.get(0));
      DataIndexer di = new TwoPassDataIndexer(new EventCollectorAsStream(new SimpleEventCollector(trainData)), 1);
      GISModel gm = GIS.trainModel(100, di);
     
      ClassificationEvaluator ce = new ClassificationEvaluator();
     
      for(Event event : testData) {
View Full Code Here


          events.add(ev);
        }
      }
      if(events.size() < 2) continue;
      DataIndexer di = null;
      di = new TwoPassDataIndexer(new EventCollectorAsStream(new SimpleEventCollector(events)), 1);
      if(Oscar3Props.getInstance().verbose) System.out.println(di);
      GISModel gm = GIS.trainModel(100, di);
      classifiers.put(type, gm);
    }
  }
View Full Code Here

   
    List<Event> trainData = events.subList(0, events.size()/2);
    List<Event> testData = events.subList(events.size()/2, events.size());
   
    if(trainData.size() == 1) trainData.add(trainData.get(0));
    DataIndexer di = new TwoPassDataIndexer(new EventCollectorAsStream(new SimpleEventCollector(trainData)), 1);
    GISModel gm = GIS.trainModel(100, di);
   
    ClassificationEvaluator ce = new ClassificationEvaluator();
   
    for(Event event : testData) {
View Full Code Here

        trainEvents.add(new Event(be.getClassLabel(), be.getFeatures().getSet().toArray(new String[0])));
      }
      for(BagEvent be : testBagEvents) {
        testEvents.add(new Event(be.getClassLabel(), be.getFeatures().getSet().toArray(new String[0])));
      }
      DataIndexer di = new TwoPassDataIndexer(new EventCollectorAsStream(new SimpleEventCollector(trainEvents)), 1);
      GISModel gm = GIS.trainModel(100, di);
     
      //ClassificationEvaluator ce = new ClassificationEvaluator();
     
      for(Event event : testEvents) {
View Full Code Here

    for(int i=0;i<numDocs/2;i++) {
      events.add(docToEvent(ir, i, c));
    }
   
    DataIndexer di = null;
    di = new TwoPassDataIndexer(new EventCollectorAsStream(new SimpleEventCollector(events)), 3);
    GISModel gm = GIS.trainModel(100, di);
 
    Map<String,Double> byProb = new HashMap<String,Double>();
    Map<String,String> res = new HashMap<String,String>();
    int mp = 0;
View Full Code Here

TOP

Related Classes of opennlp.maxent.TwoPassDataIndexer

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.