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

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


The following commit(s) were added to refs/heads/master by this push:
     new a850904  Remove hard coded seq length
a850904 is described below

commit a8509044fc1acdb7f4ee6653e902005407a79fb1
Author: Jörn Kottmann <[email protected]>
AuthorDate: Thu Nov 29 10:13:07 2018 +0100

    Remove hard coded seq length
---
 tf-ner-poc/src/main/java/org/apache/opennlp/normalizer/Normalizer.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/tf-ner-poc/src/main/java/org/apache/opennlp/normalizer/Normalizer.java 
b/tf-ner-poc/src/main/java/org/apache/opennlp/normalizer/Normalizer.java
index c3f7fbb..9c9f27b 100644
--- a/tf-ner-poc/src/main/java/org/apache/opennlp/normalizer/Normalizer.java
+++ b/tf-ner-poc/src/main/java/org/apache/opennlp/normalizer/Normalizer.java
@@ -99,9 +99,8 @@ public class Normalizer {
           .fetch("decode", 0).run();
 
       try (Tensor<?> translationTensor = result.get(0)) {
-        // TODO: This can't be hard coded ... normalized form doesn't need to 
have static length
         int[][] translations =
-            translationTensor.copyTo(new int[texts.length][9]); // shape is 
(20, 9) in eval py code
+            translationTensor.copyTo(new int[texts.length][(int) 
translationTensor.shape()[1]]);
 
         List<String> normalizedTexts = new ArrayList<>();
 

Reply via email to