Package opennlp.tools.sentdetect

Examples of opennlp.tools.sentdetect.SentenceDetectorFactory


    char eos[] = null;
    if (eosChars != null) {
      eos = eosChars.toCharArray();
    }
   
    SentenceDetectorFactory sdFactory = SentenceDetectorFactory.create(
            null, language, true, null, eos);
   
    TrainingParameters mlParams = ModelUtil.createTrainingParameters(100, 5);
   
    ObjectStream<SentenceSample> samples = ObjectStreamUtils.createObjectStream(sentenceSamples);
View Full Code Here


    if (params.getEosChars() != null)
      eos = params.getEosChars().toCharArray();

    try {
      Dictionary abbreviations = SentenceDetectorTrainerTool.loadDict(params.getAbbDict());
      SentenceDetectorFactory sdFactory = SentenceDetectorFactory.create(
          params.getFactory(), params.getLang(), true, abbreviations, eos);
      validator = new SDCrossValidator(params.getLang(), mlParams, sdFactory,
          errorListener);
     
      validator.evaluate(sampleStream, params.getFolds());
View Full Code Here

    SentenceModel model;

    try {
      Dictionary dict = loadDict(params.getAbbDict());
      SentenceDetectorFactory sdFactory = SentenceDetectorFactory.create(
          params.getFactory(), params.getLang(), true, dict, eos);
      model = SentenceDetectorME.train(params.getLang(), sampleStream,
          sdFactory, mlParams);
    } catch (IOException e) {
      throw new TerminateToolException(-1, "IO error while reading training data or indexing data: "
View Full Code Here

      eos = eosString.toCharArray();
    }

    try {
      Dictionary abbreviations = SentenceDetectorTrainerTool.loadDict(params.getAbbDict());
      SentenceDetectorFactory sdFactory = SentenceDetectorFactory.create(
          params.getFactory(), params.getLang(), true, abbreviations, eos);
      validator = new SDCrossValidator(params.getLang(), mlParams, sdFactory,
          errorListener);

      validator.evaluate(sampleStream, params.getFolds());
View Full Code Here

    SentenceModel model;

    try {
      Dictionary dict = loadDict(params.getAbbDict());
      SentenceDetectorFactory sdFactory = SentenceDetectorFactory.create(
          params.getFactory(), params.getLang(), true, dict, eos);
      model = SentenceDetectorME.train(params.getLang(), sampleStream,
          sdFactory, mlParams);
    } catch (IOException e) {
      throw new TerminateToolException(-1, "IO error while reading training data or indexing data: "
View Full Code Here

    char eos[] = null;
    if (eosChars != null) {
      eos = eosChars.toCharArray();
    }

    SentenceDetectorFactory sdFactory = SentenceDetectorFactory.create(
            null, language, true, null, eos);

  //  TrainingParameters mlParams = ModelUtil.createTrainingParameters(100, 5);
     TrainingParameters mlParams = ModelUtil.createDefaultTrainingParameters();
    ObjectStream<SentenceSample> samples = ObjectStreamUtils.createObjectStream(sentenceSamples);
View Full Code Here

TOP

Related Classes of opennlp.tools.sentdetect.SentenceDetectorFactory

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.