Package opennlp.tools.tokenize.lang

Examples of opennlp.tools.tokenize.lang.Factory


   */
  public static TokenizerModel train(String languageCode,
      ObjectStream<TokenSample> samples, Dictionary abbreviations,
      boolean useAlphaNumericOptimization, TrainingParameters mlParams)
      throws IOException {
    Factory factory = new Factory();

    Map<String, String> manifestInfoEntries = new HashMap<String, String>();

    ObjectStream<Event> eventStream = new TokSpanEventStream(samples,
        useAlphaNumericOptimization, factory.getAlphanumeric(languageCode),
        factory.createTokenContextGenerator(languageCode,
            getAbbreviations(abbreviations)));

    MaxentModel maxentModel = TrainUtil.train(eventStream,
        mlParams.getSettings(), manifestInfoEntries);

View Full Code Here

TOP

Related Classes of opennlp.tools.tokenize.lang.Factory

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.