Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPENNLP-1623: Add more test cases for Coref component #201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mawiesne
Copy link
Contributor

@mawiesne mawiesne commented Dec 20, 2024

Change

  • adds a ton of new test classes
  • adjusts TrainModel interface to return the trained model
  • fixes several undetected class cast bugs due to '@SuppressWarnings("unchecked")' cover-up
  • makes CorefTrainerTest (somehow) pass
  • makes classes named Enum be actual enums

Code-Coverage

Bildschirmfoto 2024-12-20 um 22 45 50

Tasks

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:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • 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.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp-sandbox 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?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp-sandbox folder?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp-sandbox folder?

For documentation related changes:

  • 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.

- adds a ton of new test classes
- adjusts TrainSimilarityModel interface to return the trained model
- fixes several undetected class cast bugs due to '@SuppressWarnings("unchecked")' cover-up
- makes CorefTrainerTest (somehow) pass
- makes classes named *Enum* be actual enums
@mawiesne mawiesne self-assigned this Dec 20, 2024
Copy link
Contributor

@rzo1 rzo1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks good to me. More tests, less bugs ;-)

I have added a question regarding the source (and license?) of the huge acronym txt file.

under the License.
-->
<!--
Origin: https://catalog.ldc.upenn.edu/LDC2003T13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is taken from: https://catalog.ldc.upenn.edu/desc/addenda/LDC2003T13.txt
In this case, we cannot claim, that it is ASLv2 license (had the same thing in StormCrawler Incubator with external sources). It seems "LDC User Agreement for Non-Members" applies as a license here which would be incompatible with ASLv2 (see commercial section of that PDF).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to re-create that file with arbitrary values (than we can claim ASLv2 for it).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.    
-->
<!--
This SGML file is based on the structure of https://catalog.ldc.upenn.edu/LDC2003T13
-->
<DOC>
<DOCNO>  123456-7890. </DOCNO>
<CODER> LoremIpsumCorp </CODER>
<DD> = 123456 </DD>
<AN> 123456-7890. </AN>
<HL> Lorem Ipsum:
@  Dolor Sit Amet Consectetur
@  ---
@  Adipiscing Elit, Sed Do Eiusmod
@  Tempor Incididunt Ut Labore
@  ----
@  By Lorem Ipsum
@  Placeholder Text Author </HL>
<DD> 12/12/21 </DD>
<SO> LOREM IPSUM TIMES (LIT) </SO>
<CO> UNKNOWN </CO>
<IN> PLACEHOLDER TOPICS (PTP)
TEMPORARY SUBJECTS (TMP) </IN>
<GV> FAKE DEPARTMENT (FD)
DUMMY ORGANIZATION (DO) </GV>
<DATELINE> LOREMTOWN  </DATELINE>
<TXT>
<p>
<s> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </s>
</p>
<p>
<s> Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </s>
<s> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </s>
</p>
<p>
<s> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </s>
<s> Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </s>
</p>
<p>
<s> Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien. </s>
<s> Ultrices dui sapien eget mi proin sed libero enim. </s>
</p>
<p>
<s> Non arcu risus quis varius quam quisque id diam vel. </s>
</p>
<p>
<s> Amet nisl suscipit adipiscing bibendum est ultricies integer quis. </s>
<s> Elit eget gravida cum sociis natoque penatibus et magnis dis. </s>
</p>
<p>
<s> Orci eu lobortis elementum nibh tellus molestie nunc non. </s>
<s> Vitae ultricies leo integer malesuada nunc vel risus commodo. </s>
</p>
<p>
<s> Ultricies mi quis hendrerit dolor magna eget est lorem ipsum. </s>
</p>
</DOC>

This follows the format of the file, but is arbitrary, generated content just following the structure to be testable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants