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

[jira] [Commented] (OPENNLP-1308) Incorrect code snippet in Name Finder Training -> Training Api

    [ https://issues.apache.org/jira/browse/OPENNLP-1308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17187709#comment-17187709 ] 

Jeffrey T. Zemerick commented on OPENNLP-1308:
----------------------------------------------

Hi [~sln2], thanks for creating this issue! Would you be able to make a pull request for your changes at [https://github.com/apache/opennlp]? 

> 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)