You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by "krickert (via GitHub)" <gi...@apache.org> on 2026/06/10 11:59:35 UTC

[PR] OPENNLP-1836 - Fix input encoding in SentenceVectorsDL (opennlp)

krickert opened a new pull request, #1072:
URL: https://github.com/apache/opennlp/pull/1072

   See https://issues.apache.org/jira/browse/OPENNLP-1836
   
   SentenceVectorsDL sent an all-zero attention_mask and all-one token_type_ids to the ONNX model, so the encoder attended to nothing. This fixes the encoding to the standard single-segment BERT convention (mask=1, types=0), consistent with DocumentCategorizerDL, and additionally:
   
   - closes the OnnxTensor inputs and OrtSession.Result (native memory leak)
   - replaces the NPE on a vocabulary miss with a descriptive IllegalArgumentException
   - adds a unit test for the encoding (tokenize is now package-private static, no ONNX session needed)
   - updates SentenceVectorsDLEval expectations
   
   Eval values were verified empirically: the unfixed code reproduces the previously pinned values exactly against the public sentence-transformers/all-MiniLM-L6-v2 ONNX export, and the corrected encoding produces the new pinned values (dimension 384).
   
   Note: this is a behavioral fix - vectors persisted from the old encoding are not comparable with the corrected output and should be re-embedded.


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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on code in PR #1072:
URL: https://github.com/apache/opennlp/pull/1072#discussion_r3403900836


##########
opennlp-eval-tests/src/test/java/opennlp/dl/vectors/SentenceVectorsDLEval.java:
##########
@@ -38,10 +38,10 @@ public void generateVectorsTest() throws Exception {
 
       final float[] vectors = sv.getVectors(sentence);
 
-      Assertions.assertEquals(vectors[0], 0.39994872, 0.00001);
-      Assertions.assertEquals(vectors[1], -0.055101186, 0.00001);
-      Assertions.assertEquals(vectors[2], 0.2817594, 0.00001);
-      Assertions.assertEquals(vectors.length, 384);
+      Assertions.assertEquals(0.044745024, vectors[0], 0.00001);

Review Comment:
   Lovely!



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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

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

   Thanks and addressed:
   
   **1. Release notes:** The breaking change is now documented in three places: the PR body, a **Release Note** paragraph on the OPENNLP-1836 JIRA (please paste the text below into the JIRA Release Note field), and the `SentenceVectorsDL` class Javadoc (`Release note (OpenNLP 3.0.0)` paragraph in commit 33b15e4f). Targeting 3.0.0, not a patch release.
   
   **2. DocumentCategorizerDL follow-up:** Filed as OPENNLP-1839 (leak + vocab-miss handling; 2.x backport of leak/error-handling only to discuss there).
   
   **Copilot:** `assertEquals` argument order was already corrected in 15fc495a.


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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

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

   I think it can land in M4 (because breaking can be expected). It just needs to be in the rel-notes.


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


Re: [PR] OPENNLP-1836 - Fix input encoding in SentenceVectorsDL (opennlp)

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1072:
URL: https://github.com/apache/opennlp/pull/1072#discussion_r3388727588


##########
opennlp-eval-tests/src/test/java/opennlp/dl/vectors/SentenceVectorsDLEval.java:
##########
@@ -38,9 +38,9 @@ public void generateVectorsTest() throws Exception {
 
       final float[] vectors = sv.getVectors(sentence);
 
-      Assertions.assertEquals(vectors[0], 0.39994872, 0.00001);
-      Assertions.assertEquals(vectors[1], -0.055101186, 0.00001);
-      Assertions.assertEquals(vectors[2], 0.2817594, 0.00001);
+      Assertions.assertEquals(vectors[0], 0.044745024, 0.00001);
+      Assertions.assertEquals(vectors[1], 0.20219636, 0.00001);
+      Assertions.assertEquals(vectors[2], 0.41306049, 0.00001);
       Assertions.assertEquals(vectors.length, 384);

Review Comment:
   The JUnit `assertEquals` calls have the `expected` and `actual` arguments reversed here, which makes failure messages misleading. Swap the parameters so the pinned constants are the expected values and the computed vector entries are the actual values (same for the length check).



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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on code in PR #1072:
URL: https://github.com/apache/opennlp/pull/1072#discussion_r3403897272


##########
opennlp-core/opennlp-ml/opennlp-dl/src/main/java/opennlp/dl/vectors/SentenceVectorsDL.java:
##########
@@ -72,38 +84,61 @@ public float[] getVectors(final String sentence) throws OrtException {
 
     final Map<String, OnnxTensor> inputs = new HashMap<>();
 
-    inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
-        new long[] {1, tokens.ids().length}));
-
-    inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
+    try {
+      inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
+          new long[] {1, tokens.ids().length}));
 
-    inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
+      inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
 
-    final float[][][] v = (float[][][]) session.run(inputs).get(0).getValue();
+      inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
 
-    return v[0][0];
+      try (OrtSession.Result result = session.run(inputs)) {
+        // getValue() copies the tensor into Java arrays, so the result can be closed safely.
+        final float[][][] v = (float[][][]) result.get(0).getValue();
+        return v[0][0];
+      }
+    } finally {
+      inputs.values().forEach(OnnxTensor::close);
+    }
 
   }
 
-  private Tokens tokenize(final String text, Tokenizer tokenizer, Map<String, Integer> vocab) {
+  /**
+   * Encodes text as model inputs: wordpiece token ids, an attention mask of ones,
+   * and single-segment (all zero) token type ids.
+   *
+   * @param text The text to encode.
+   * @param tokenizer The wordpiece tokenizer matching the {@code vocab}.
+   * @param vocab The vocabulary map.
+   * @return The encoded {@link Tokens}.
+   *
+   * @throws IllegalArgumentException Thrown if the tokenizer emits a token that is
+   *     not present in the vocabulary.
+   */
+  static Tokens tokenize(final String text, final Tokenizer tokenizer,

Review Comment:
   Thx for giving a rational / explanation.



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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

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

   @krickert Do I understand correctly, that this MR should target the 3.0.0 release and **not** the related M4 milestone? Pls clarify, wdyt?


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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on code in PR #1072:
URL: https://github.com/apache/opennlp/pull/1072#discussion_r3403237307


##########
opennlp-core/opennlp-ml/opennlp-dl/src/main/java/opennlp/dl/vectors/SentenceVectorsDL.java:
##########
@@ -72,38 +84,61 @@ public float[] getVectors(final String sentence) throws OrtException {
 
     final Map<String, OnnxTensor> inputs = new HashMap<>();
 
-    inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
-        new long[] {1, tokens.ids().length}));
-
-    inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
+    try {
+      inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
+          new long[] {1, tokens.ids().length}));
 
-    inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
+      inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
 
-    final float[][][] v = (float[][][]) session.run(inputs).get(0).getValue();
+      inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
 
-    return v[0][0];
+      try (OrtSession.Result result = session.run(inputs)) {
+        // getValue() copies the tensor into Java arrays, so the result can be closed safely.
+        final float[][][] v = (float[][][]) result.get(0).getValue();
+        return v[0][0];
+      }
+    } finally {
+      inputs.values().forEach(OnnxTensor::close);
+    }
 
   }
 
-  private Tokens tokenize(final String text, Tokenizer tokenizer, Map<String, Integer> vocab) {
+  /**
+   * Encodes text as model inputs: wordpiece token ids, an attention mask of ones,
+   * and single-segment (all zero) token type ids.
+   *
+   * @param text The text to encode.
+   * @param tokenizer The wordpiece tokenizer matching the {@code vocab}.
+   * @param vocab The vocabulary map.
+   * @return The encoded {@link Tokens}.
+   *
+   * @throws IllegalArgumentException Thrown if the tokenizer emits a token that is
+   *     not present in the vocabulary.
+   */
+  static Tokens tokenize(final String text, final Tokenizer tokenizer,

Review Comment:
   @krickert Previously, this method was not declared `static`. Is there a real reason for it to be `static` now?



##########
opennlp-eval-tests/src/test/java/opennlp/dl/vectors/SentenceVectorsDLEval.java:
##########
@@ -38,10 +38,10 @@ public void generateVectorsTest() throws Exception {
 
       final float[] vectors = sv.getVectors(sentence);
 
-      Assertions.assertEquals(vectors[0], 0.39994872, 0.00001);
-      Assertions.assertEquals(vectors[1], -0.055101186, 0.00001);
-      Assertions.assertEquals(vectors[2], 0.2817594, 0.00001);
-      Assertions.assertEquals(vectors.length, 384);
+      Assertions.assertEquals(0.044745024, vectors[0], 0.00001);

Review Comment:
   Can you add a code comment where the expected four values of this test originate from? It would be nice to drop a URL here, so other can better follow in the future. I know... they've been here before. Comment is more a reproducibility thing.



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


Re: [PR] OPENNLP-1836 - Fix input encoding in SentenceVectorsDL (opennlp)

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

   Ran copilot against this.  It didn't do a bad job because it only said that the expected vs actual were reversed.  


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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

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

   I would love it if these PRs can make it in M4 - it'll make the grpc sandbox code usable and testable right away.


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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

Posted by "krickert (via GitHub)" <gi...@apache.org>.
krickert commented on code in PR #1072:
URL: https://github.com/apache/opennlp/pull/1072#discussion_r3403700306


##########
opennlp-core/opennlp-ml/opennlp-dl/src/main/java/opennlp/dl/vectors/SentenceVectorsDL.java:
##########
@@ -72,38 +84,61 @@ public float[] getVectors(final String sentence) throws OrtException {
 
     final Map<String, OnnxTensor> inputs = new HashMap<>();
 
-    inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
-        new long[] {1, tokens.ids().length}));
-
-    inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
+    try {
+      inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
+          new long[] {1, tokens.ids().length}));
 
-    inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
+      inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
 
-    final float[][][] v = (float[][][]) session.run(inputs).get(0).getValue();
+      inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
 
-    return v[0][0];
+      try (OrtSession.Result result = session.run(inputs)) {
+        // getValue() copies the tensor into Java arrays, so the result can be closed safely.
+        final float[][][] v = (float[][][]) result.get(0).getValue();
+        return v[0][0];
+      }
+    } finally {
+      inputs.values().forEach(OnnxTensor::close);
+    }
 
   }
 
-  private Tokens tokenize(final String text, Tokenizer tokenizer, Map<String, Integer> vocab) {
+  /**
+   * Encodes text as model inputs: wordpiece token ids, an attention mask of ones,
+   * and single-segment (all zero) token type ids.
+   *
+   * @param text The text to encode.
+   * @param tokenizer The wordpiece tokenizer matching the {@code vocab}.
+   * @param vocab The vocabulary map.
+   * @return The encoded {@link Tokens}.
+   *
+   * @throws IllegalArgumentException Thrown if the tokenizer emits a token that is
+   *     not present in the vocabulary.
+   */
+  static Tokens tokenize(final String text, final Tokenizer tokenizer,

Review Comment:
   It's deliberate: `tokenize` is a pure function of its arguments (no instance state), and making it `static` lets the new `SentenceVectorsDLTest` exercise the encoding and the out-of-vocabulary error path directly, without needing a real ONNX session and model file to construct a `SentenceVectorsDL` instance. The method is package-private, so the public API is unchanged.



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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

Posted by "krickert (via GitHub)" <gi...@apache.org>.
krickert commented on code in PR #1072:
URL: https://github.com/apache/opennlp/pull/1072#discussion_r3403719995


##########
opennlp-eval-tests/src/test/java/opennlp/dl/vectors/SentenceVectorsDLEval.java:
##########
@@ -38,10 +38,10 @@ public void generateVectorsTest() throws Exception {
 
       final float[] vectors = sv.getVectors(sentence);
 
-      Assertions.assertEquals(vectors[0], 0.39994872, 0.00001);
-      Assertions.assertEquals(vectors[1], -0.055101186, 0.00001);
-      Assertions.assertEquals(vectors[2], 0.2817594, 0.00001);
-      Assertions.assertEquals(vectors.length, 384);
+      Assertions.assertEquals(0.044745024, vectors[0], 0.00001);

Review Comment:
   Done, added a comment block above the assertions documenting where the values come from.
   
   The pinned values are the first three components of `last_hidden_state[0][0]` (the `[CLS]` position) produced by the ONNX export of [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) for the input `[CLS] george washington was president [SEP]` with the corrected encoding (`attention_mask=1`, `token_type_ids=0`).
   
   They are reproducible independently of OpenNLP with the HuggingFace reference implementation (Python packages `tokenizers` and `onnxruntime`):
   
   ```python
   tok = BertWordPieceTokenizer("vocab.txt", lowercase=True)
   enc = tok.encode("george washington was president", add_special_tokens=True)
   ids = np.array([enc.ids], dtype=np.int64)
   out = ort.InferenceSession("model.onnx").run(None, {
       "input_ids": ids,
       "attention_mask": np.ones_like(ids),
       "token_type_ids": np.zeros_like(ids)})[0]
   out[0][0][:3]  # -> [0.04474502, 0.20219636, 0.41306049]
   ```
   
   I re-ran this against the eval model before pinning the comment; the three values match exactly.



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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

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


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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

Posted by "krickert (via GitHub)" <gi...@apache.org>.
krickert commented on code in PR #1072:
URL: https://github.com/apache/opennlp/pull/1072#discussion_r3403700306


##########
opennlp-core/opennlp-ml/opennlp-dl/src/main/java/opennlp/dl/vectors/SentenceVectorsDL.java:
##########
@@ -72,38 +84,61 @@ public float[] getVectors(final String sentence) throws OrtException {
 
     final Map<String, OnnxTensor> inputs = new HashMap<>();
 
-    inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
-        new long[] {1, tokens.ids().length}));
-
-    inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
+    try {
+      inputs.put(INPUT_IDS, OnnxTensor.createTensor(env, LongBuffer.wrap(tokens.ids()),
+          new long[] {1, tokens.ids().length}));
 
-    inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
-        LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
+      inputs.put(ATTENTION_MASK, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.mask()), new long[] {1, tokens.mask().length}));
 
-    final float[][][] v = (float[][][]) session.run(inputs).get(0).getValue();
+      inputs.put(TOKEN_TYPE_IDS, OnnxTensor.createTensor(env,
+          LongBuffer.wrap(tokens.types()), new long[] {1, tokens.types().length}));
 
-    return v[0][0];
+      try (OrtSession.Result result = session.run(inputs)) {
+        // getValue() copies the tensor into Java arrays, so the result can be closed safely.
+        final float[][][] v = (float[][][]) result.get(0).getValue();
+        return v[0][0];
+      }
+    } finally {
+      inputs.values().forEach(OnnxTensor::close);
+    }
 
   }
 
-  private Tokens tokenize(final String text, Tokenizer tokenizer, Map<String, Integer> vocab) {
+  /**
+   * Encodes text as model inputs: wordpiece token ids, an attention mask of ones,
+   * and single-segment (all zero) token type ids.
+   *
+   * @param text The text to encode.
+   * @param tokenizer The wordpiece tokenizer matching the {@code vocab}.
+   * @param vocab The vocabulary map.
+   * @return The encoded {@link Tokens}.
+   *
+   * @throws IllegalArgumentException Thrown if the tokenizer emits a token that is
+   *     not present in the vocabulary.
+   */
+  static Tokens tokenize(final String text, final Tokenizer tokenizer,

Review Comment:
   It's deliberate: {{tokenize}} is a pure function of its arguments (no instance state), and making it {{static}} lets the new {{SentenceVectorsDLTest}} exercise the encoding and the out-of-vocabulary error path directly, without needing a real ONNX session and model file to construct a {{SentenceVectorsDL}} instance. The method is package-private, so the public API is unchanged.



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


Re: [PR] OPENNLP-1836: Fix input encoding in SentenceVectorsDL (opennlp)

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

   🍒 -picked to `opennlp-2.x`


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