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

[jira] [Created] (OPENNLP-1308) Docs to correct

Mikalai Dudko created OPENNLP-1308:
--------------------------------------

             Summary: Docs to correct
                 Key: OPENNLP-1308
                 URL: https://issues.apache.org/jira/browse/OPENNLP-1308
             Project: OpenNLP
          Issue Type: Documentation
            Reporter: Mikalai Dudko


Manual -> Training Api section -> TokenNameFinderFactory and modelOut
{code:java}
ObjectStream<String> lineStream =
		new PlainTextByLineStream(new FileInputStream("en-ner-person.train"), StandardCharsets.UTF_8);

TokenNameFinderModel model;

try (ObjectStream<NameSample> sampleStream = new NameSampleDataStream(lineStream)) {
  model = NameFinderME.train("en", "person", sampleStream, TrainingParameters.defaultParams(),
            TokenNameFinderFactory nameFinderFactory);
}

try (modelOut = new BufferedOutputStream(new FileOutputStream(modelFile)){
  model.serialize(modelOut);
}
{code}



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