Examples of SentenceDetectorFactory


Examples of com.tamingtext.util.SentenceDetectorFactory

  @Override
  public void init(Map<String,String> args) {
    super.init(args);
   
    try {
      sentenceDetectorFactory = new SentenceDetectorFactory(args);
    }
    catch (IOException e) {
      throw (RuntimeException) new RuntimeException().initCause(e);
    }
  }
View Full Code Here

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

Examples of opennlp.tools.sentdetect.SentenceDetectorFactory

    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

Examples of opennlp.tools.sentdetect.SentenceDetectorFactory

    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

Examples of opennlp.tools.sentdetect.SentenceDetectorFactory

      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

Examples of opennlp.tools.sentdetect.SentenceDetectorFactory

    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

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);
     TrainingParameters mlParams = ModelUtil.createDefaultTrainingParameters();
    ObjectStream<SentenceSample> samples = ObjectStreamUtils.createObjectStream(sentenceSamples);
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.