You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2018/05/30 10:00:19 UTC

[opennlp-sandbox] branch master updated: Fix loading of dicts by removing GZIP decompressor

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 12b2c65  Fix loading of dicts by removing GZIP decompressor
12b2c65 is described below

commit 12b2c65fb8a4580e4a3b57b9ccc0960964bf3728
Author: Jörn Kottmann <jo...@apache.org>
AuthorDate: Wed May 30 11:59:37 2018 +0200

    Fix loading of dicts by removing GZIP decompressor
---
 .../opennlp/tf/guillaumegenthial/SequenceTagging.java     | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tf-ner-poc/src/main/java/org/apache/opennlp/tf/guillaumegenthial/SequenceTagging.java b/tf-ner-poc/src/main/java/org/apache/opennlp/tf/guillaumegenthial/SequenceTagging.java
index 4c0c738..653b58a 100644
--- a/tf-ner-poc/src/main/java/org/apache/opennlp/tf/guillaumegenthial/SequenceTagging.java
+++ b/tf-ner-poc/src/main/java/org/apache/opennlp/tf/guillaumegenthial/SequenceTagging.java
@@ -35,11 +35,16 @@ public class SequenceTagging implements AutoCloseable {
   private final IndexTagger indexTagger;
 
   public SequenceTagging(PredictionConfiguration config) throws IOException {
-    this.model = SavedModelBundle.load(config.getSavedModel(), "serve");
-    this.session = model.session();
-    this.wordIndexer = new WordIndexer(new GZIPInputStream(new FileInputStream(config.getVocabWords())),
-            new GZIPInputStream(new FileInputStream(config.getVocabChars())));
-    this.indexTagger = new IndexTagger(new GZIPInputStream(new FileInputStream(config.getVocabTags())));
+    model = SavedModelBundle.load(config.getSavedModel(), "serve");
+    session = model.session();
+
+
+    Iterator<Operation> opit = model.graph().operations();
+
+    this.wordIndexer = new WordIndexer(new FileInputStream(config.getVocabWords()),
+            new FileInputStream(config.getVocabChars()));
+
+    this.indexTagger = new IndexTagger((new FileInputStream(config.getVocabTags())));
   }
 
   public String[] predict(String[] sentence) {

-- 
To stop receiving notification emails like this one, please contact
joern@apache.org.