You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Alan Wang (Jira)" <ji...@apache.org> on 2020/12/11 08:51:00 UTC

[jira] [Created] (OPENNLP-1319) The Training API code is outdated in Manuel

Alan Wang created OPENNLP-1319:
----------------------------------

             Summary: The Training API code is outdated in Manuel
                 Key: OPENNLP-1319
                 URL: https://issues.apache.org/jira/browse/OPENNLP-1319
             Project: OpenNLP
          Issue Type: Documentation
            Reporter: Alan Wang


 {code:java}
POSModel model = null;

try (InputStream dataIn = new FileInputStream("en-pos.train")){
  ObjectStream<String> lineStream = new PlainTextByLineStream(dataIn, StandardCharsets.UTF_8);
  ObjectStream<POSSample> sampleStream = new WordTagSampleStream(lineStream);

  model = POSTaggerME.train("en", sampleStream, TrainingParameters.defaultParams(), null, null);
}
{code}
1、PlainTextByLineStream use InputStreamFactory now.

2、Update parameters of the train method.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)