[
https://issues.apache.org/jira/browse/OPENNLP-1308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17199102#comment-17199102
]
ASF GitHub Bot commented on OPENNLP-1308:
-----------------------------------------
jzonthemtn commented on pull request #378:
URL: https://github.com/apache/opennlp/pull/378#issuecomment-695847700
@MikalaiD Thanks for the contribution!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Incorrect code snippet in Name Finder Training -> Training Api
> --------------------------------------------------------------
>
> Key: OPENNLP-1308
> URL: https://issues.apache.org/jira/browse/OPENNLP-1308
> Project: OpenNLP
> Issue Type: Documentation
> Reporter: Mikalai Dudko
> Priority: Trivial
>
> Manual -> Name Finder Training -> 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)