This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opennlp.git


The following commit(s) were added to refs/heads/main by this push:
     new a6f19f91e GH-1449: Align DocumentCategorizerDLEval with the shared 
ONNX failure message (#1463)
a6f19f91e is described below

commit a6f19f91e1df0e445e1312309d282db29c018407
Author: Richard Zowalla <[email protected]>
AuthorDate: Fri Oct 9 20:50:26 2026 +0200

    GH-1449: Align DocumentCategorizerDLEval with the shared ONNX failure 
message (#1463)
    
    #1450 moved the inference of DocumentCategorizerDL to AbstractDL.runModel, 
which reports
    failures as "Unable to run the ONNX model: <cause>".
---
 .../src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/opennlp-eval-tests/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java
 
b/opennlp-eval-tests/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java
index 5778b7438..6500d5fff 100644
--- 
a/opennlp-eval-tests/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java
+++ 
b/opennlp-eval-tests/src/test/java/opennlp/dl/doccat/DocumentCategorizerDLEval.java
@@ -171,7 +171,8 @@ public class DocumentCategorizerDLEval extends 
AbstractEvalTest {
       // distribution.
       final IllegalStateException e = 
Assertions.assertThrows(IllegalStateException.class, () ->
           documentCategorizerDL.categorize(new String[] {"hello world"}));
-      Assertions.assertTrue(e.getMessage().contains("document classification 
inference"));
+      Assertions.assertTrue(e.getMessage().startsWith("Unable to run the ONNX 
model: "),
+          e.getMessage());
 
       // The dependent API must not mask that inference failure with all-zero 
scores.
       Assertions.assertThrows(IllegalStateException.class, () ->

Reply via email to