[
https://issues.apache.org/jira/browse/OPENNLP-1366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623584#comment-17623584
]
ASF GitHub Bot commented on OPENNLP-1366:
-----------------------------------------
mawiesne opened a new pull request, #427:
URL: https://github.com/apache/opennlp/pull/427
Thank you for contributing to Apache OpenNLP.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [x] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [x] Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA
number you are trying to resolve? Pay particular attention to the hyphen "-"
character.
- [x] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [x] Is your initial contribution a single, squashed commit?
### For code changes:
- [x] Have you ensured that the full suite of tests is executed via mvn
clean install at the root opennlp folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file, including the main
LICENSE file in opennlp folder?
- [ ] If applicable, have you updated the NOTICE file, including the main
NOTICE file found in opennlp folder?
### For documentation related changes:
- [x] Have you ensured that format looks appropriate for the output in which
it is rendered?
### Note:
Please ensure that once the PR is submitted, you check GitHub Actions for
build issues and submit an update to your PR as soon as possible.
> Training of MaxEnt Model with large corpora fails with
> java.io.UTFDataFormatException
> --------------------------------------------------------------------------------------
>
> Key: OPENNLP-1366
> URL: https://issues.apache.org/jira/browse/OPENNLP-1366
> Project: OpenNLP
> Issue Type: Improvement
> Components: Lemmatizer
> Affects Versions: 1.9.4
> Reporter: Richard Zowalla
> Assignee: Jeff Zemerick
> Priority: Major
>
> As written on
> [[email protected]|[https://lists.apache.org/thread/vc5lfzj81tco703noqxpvy8sfj8fw8b1]],
> we are working on training a large opennlp maxent model for lemmatizing
> German texts. We use a wikipedia tree bank from Tübingen.
> This consumes > 2 TB of RAM during training but will finish after some time.
> However, writing this model will result in a java.io.UTFDataFormatException
> However, training such a big model isn't feasable for debugging. Gladly, a
> similar with a smaller dataset is found on Stackoverflow:
> [https://stackoverflow.com/questions/70064477/opennlp-lemmatizertrainer-utfdataformatexception-encoded-string-too-long]
>
> It contains the OpenNLP CLI command to train a lemmatizer on a much smaller
> dataset.
> The stacktrace is raced while writing a String as UTF in DataOutputStream,
> which has a hard-coded size limitation in the JDK (for reasons behind my
> knowledge ;))
> Stacktrace:
> {code:java}
> java.io.UTFDataFormatException: encoded string too long: 383769 bytes
> at
> java.base/java.io.DataOutputStream.writeUTF(DataOutputStream.java:364)
> at
> java.base/java.io.DataOutputStream.writeUTF(DataOutputStream.java:323)
> at
> opennlp.tools.ml.maxent.io.BinaryGISModelWriter.writeUTF(BinaryGISModelWriter.java:71)
> at
> opennlp.tools.ml.maxent.io.GISModelWriter.persist(GISModelWriter.java:97)
> at
> opennlp.tools.ml.model.GenericModelWriter.persist(GenericModelWriter.java:75)
> at opennlp.tools.util.model.ModelUtil.writeModel(ModelUtil.java:71)
> at
> opennlp.tools.util.model.GenericModelSerializer.serialize(GenericModelSerializer.java:36)
> at
> opennlp.tools.util.model.GenericModelSerializer.serialize(GenericModelSerializer.java:29)
> at opennlp.tools.util.model.BaseModel.serialize(BaseModel.java:597)
> at opennlp.tools.cmdline.CmdLineUtil.writeModel(CmdLineUtil.java:182)
> at
> opennlp.tools.cmdline.lemmatizer.LemmatizerTrainerTool.run(LemmatizerTrainerTool.java:77)
> at opennlp.tools.cmdline.CLI.main(CLI.java:256) {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)