Package opennlp.maxent.io

Examples of opennlp.maxent.io.SuffixSensitiveGISModelWriter


            model = GIS.trainModel(es,USE_SMOOTHING);
          }
          else {
            model = GIS.trainModel(100, new OnePassRealValueDataIndexer(es,0), USE_SMOOTHING);
          }
          writer =  new SuffixSensitiveGISModelWriter(model, outputFile);
        }
        else if (type.equals("perceptron")){
          System.err.println("Perceptron training");
          model = new PerceptronTrainer().trainModel(10, new OnePassDataIndexer(es,0),0);
          writer = new SuffixSensitivePerceptronModelWriter(model, outputFile);
View Full Code Here


    try {
      model = GIS.trainModel(iterations, new OnePassRealValueDataIndexer(es, cutoff));
    } finally {
      es.close();
    }
    new SuffixSensitiveGISModelWriter(model, new File(eventFile + ".bin.gz")).persist();
  }
View Full Code Here

          model = GIS.trainModel(maxit,
         new OnePassRealValueDataIndexer(es, cutoff),             
         USE_SMOOTHING);
        }

  writer = new SuffixSensitiveGISModelWriter(model, outputFile);

      } else if (type.equals("perceptron")) {
        //System.err.println("Perceptron training");
        model = new PerceptronTrainer().trainModel(maxit, new OnePassDataIndexer(es, cutoff), cutoff);
View Full Code Here

    try {
      model = GIS.trainModel(es,iterations,cutoff);
    } finally {
      es.close();
    }
    new SuffixSensitiveGISModelWriter(model, new File(eventFile+".bin.gz")).persist();
  }
View Full Code Here

        Event e = ei.next();
        writer.write(e.toString()+"\n");
      }
      writer.close();
    }
    (new SuffixSensitiveGISModelWriter(GIS.trainModel(
        new CollectionEventStream(events),100,10),
        new File(modelName+modelExtension))).persist();
  }
View Full Code Here

   * @throws IOException
   */
  @Deprecated
  public static void trainMaxentModel(EventStream evc, File modelFile) throws IOException {
    AbstractModel model = trainMaxentModel(evc, 100,5);
    new SuffixSensitiveGISModelWriter(model, modelFile).persist();
  }
View Full Code Here

        else {
          mod = trainMaxentModel(es, iterations, cutoff);

          System.out.println("Saving the model as: " + outFile);

          new SuffixSensitiveGISModelWriter(mod, outFile).persist();
        }
      }
    }
    catch (Exception e) {
      e.printStackTrace();
View Full Code Here

        ReVerbOpenNlpClassifierTrainer trainer = new ReVerbOpenNlpClassifierTrainer(
                reader.readExtractions());
        GISModel model = trainer.getModel();

        File outputFile = new File(args[1]);
        GISModelWriter writer = new SuffixSensitiveGISModelWriter(model, outputFile);
        writer.persist();
    }
View Full Code Here

        System.err.println("Unknown model type: " + type);
        model = null;
      }

      File outputFile = new File(modelFileName);
      GISModelWriter writer = new SuffixSensitiveGISModelWriter(model,
          outputFile);
      writer.persist();
    } catch (Exception e) {
      System.out.print("Unable to create model due to exception: ");
      System.out.println(e);
      e.printStackTrace();
    }
View Full Code Here

          Event e = ei.next();
          writer.write(e.toString()+"\n");
        }
        writer.close();
      }
      (new SuffixSensitiveGISModelWriter(GIS.trainModel(new CollectionEventStream(events),100,10),new File(modelName+modelExtension))).persist();
      nonReferentialResolver.train();
    }
  }
View Full Code Here

TOP

Related Classes of opennlp.maxent.io.SuffixSensitiveGISModelWriter

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.