You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by "mawiesne (via GitHub)" <gi...@apache.org> on 2023/02/24 18:02:11 UTC

[GitHub] [opennlp-sandbox] mawiesne opened a new pull request, #89: Sanitize some TODOs and unhealthy code

mawiesne opened a new pull request, #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89

   Change
   -
   - addresses open TODO in `PredictTest` which is now only display if platform arch is 'aarch64' (aka Apple Silicon)
   - fixes incomplete resource handling of IO streams
   - adds Override annotation where useful
   - extracts regex Patterns instead of inline recompilation of those in loops
   - removes "dead" (unused) `FileHandler` class which was flawed for several reasons anyway
   - removes unused ImageIO / AWT bound code from `Utils` class
   - clears some unused variables/fields
   - removes some unclear TODO leftovers
   - fixes some broken indentation along the path
   
   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.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [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-sandbox folder?
   - [x] 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](https://www.apache.org/legal/resolved.html#category-a)? 
   - [ ] 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.
   


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444399423

   > > I bet, that it was generated by the python code in main/python
   > 
   > Any chance we/you can regenerate it with that python code?
   
   No idea about that python code, but all of these scripts require train, test and dev data, which isn't available in the repo.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444167021

   @kinow  / @rzo1 Could one or both of you please check this on your machine / env:
   
   ```
   [INFO] Running org.apache.opennlp.namefinder.PredictTest
   Error:  2023-02-24 18:04:27.985054: I tensorflow/cc/saved_model/reader.cc:31] Reading SavedModel from: savedmodel
   Error:  2023-02-24 18:04:27.985780: I tensorflow/cc/saved_model/loader.cc:311] SavedModel load for tags { serve }; Status: fail. Took 736 microseconds.
   Error:  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.955 s <<< FAILURE! - in org.apache.opennlp.namefinder.PredictTest
   Error:  org.apache.opennlp.namefinder.PredictTest.testFindTokens  Time elapsed: 0.938 s  <<< ERROR!
   org.tensorflow.TensorFlowException: Could not find SavedModel .pb or .pbtxt at supplied export directory path: savedmodel
   ```
   
   That's the test that was disabled for architecture reasons. I can't work that one out here. No that it is re-enabled it shows other issues, it seems. Thx for support.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444234329

   @kinow If you can figure out or have a fix for it, let me know. Otherwise we might need to disable this test again.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1445171068

   > Probably better to ignore that test until we/someone have time to create a model for this test.
   
   I will adjust the PR in this direction. Stay tuned.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444422141

   https://github.com/guillaumegenthial/tf_ner has some example data, which doesn't comply with our data contained in resources (if you extract the tar.gz files). Don't think, we will be able to re-create that file with the content from the tf_ner repository. Maybe @kinow is more familar with :snake: code.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444457579

   `namefinder.py` was modified with `5e8d0da1` (last commit, which mentions the `savedmodel` file within python). Afterwards, the code was heavily modified to output zip files. Guess, that the "test" wasn't adjusted.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] kinow commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1445054081

   >In the end, we are missing the data or instructions on how to create it from the test/resources data smile
   
   Had a look at the Java & Python code, and it really looks like that test is missing the saved model. Probably better to ignore that test until we/someone have time to create a model for this test. From the Python scripts, I think `namecat`  could be the script used to produce the model?


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444379351

   > I bet, that it was generated by the python code in main/python
   
   Any chance we/you can regenerate it with that python code?


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444273335

   Obviously, we don't have what's called `savedmodel` in TensorFlow in that component / test. 


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] rzo1 commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444335636

   > Obviously, we don't have what's called `savedmodel` in TensorFlow in that component / test.
   
   It once was 
   
   ```java
   String model = PredictTest.class.getResource("/savedmodel").getPath();
   ```
   
   and obviously this file doesn't exist in `resources`.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444407821

   > which isn't available in the repo.
   
   Maybe this is helpful. https://github.com/guillaumegenthial/tf_ner, seems to be a newer version and has those files.


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] mawiesne merged pull request #89: Sanitize some TODOs and unhealthy code

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne merged PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [opennlp-sandbox] kinow commented on pull request #89: Sanitize some TODOs and unhealthy code

Posted by "kinow (via GitHub)" <gi...@apache.org>.
kinow commented on PR #89:
URL: https://github.com/apache/opennlp-sandbox/pull/89#issuecomment-1444202639

   >@kinow / @rzo1 Could one or both of you please check this on your machine / env:
   
   ```bash
   $ mvn clean test -Dtest=PredictTest
   ...
   [INFO] Running org.apache.opennlp.namefinder.PredictTest
   [ERROR] 2023-02-24 19:19:44.499735: I tensorflow/cc/saved_model/reader.cc:31] Reading SavedModel from: savedmodel
   [ERROR] 2023-02-24 19:19:44.499798: I tensorflow/cc/saved_model/loader.cc:311] SavedModel load for tags { serve }; Status: fail. Took 77 microseconds.
   [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.941 s <<< FAILURE! - in org.apache.opennlp.namefinder.PredictTest
   [ERROR] org.apache.opennlp.namefinder.PredictTest.testFindTokens  Time elapsed: 0.915 s  <<< ERROR!
   org.tensorflow.TensorFlowException: Could not find SavedModel .pb or .pbtxt at supplied export directory path: savedmodel
   	at org.apache.opennlp.namefinder.PredictTest.testFindTokens(PredictTest.java:47)
   
   [INFO] 
   [INFO] Results:
   [INFO] 
   [ERROR] Errors: 
   [ERROR]   PredictTest.testFindTokens:47 ยป TensorFlow Could not find SavedModel .pb or .p...
   [INFO] 
   [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
   ```
   
   & env
   
   ```bash
   $ mvn -v
   Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
   Maven home: /opt/apache-maven-3.8.5
   Java version: 17.0.5, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64
   Default locale: en_US, platform encoding: UTF-8
   OS name: "linux", version: "5.15.0-60-generic", arch: "amd64", family: "unix"
   ```


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

To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org