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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3718147  OPENNLP-1306: Adding context to NER training errors. (#406)
3718147 is described below

commit 37181479b432280a296da8746b275398a56669d9
Author: Jeff Zemerick <[email protected]>
AuthorDate: Tue Mar 22 11:06:28 2022 -0400

    OPENNLP-1306: Adding context to NER training errors. (#406)
---
 opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java 
b/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java
index fb6b33b..e90c663 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java
@@ -76,8 +76,9 @@ public class NameSample implements Serializable {
     if (this.names.size() > 1) {
       for (int i = 1; i < this.names.size(); i++) {
         if (this.names.get(i).getStart() < this.names.get(i - 1).getEnd()) {
-          throw new RuntimeException(String.format("name spans %s and %s are 
overlapped in file: %s",
-              this.names.get(i - 1), this.names.get(i), id));
+          throw new RuntimeException(String.format("name spans %s and %s are 
overlapped in file: %s," +
+                  " sentence: %s",
+              this.names.get(i - 1), this.names.get(i), id, 
this.sentence.toString()));
         }
       }
     }

Reply via email to