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/10/10 13:18:45 UTC

[opennlp-sandbox] branch ntags_fix created (now 9f03420)

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

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


      at 9f03420  Compute ntags based on label dict size

This branch includes the following new commits:

     new 9f03420  Compute ntags based on label dict size

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[opennlp-sandbox] 01/01: Compute ntags based on label dict size

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9f03420f1071133ad6fd897331b0001e98b6dafc
Author: Jörn Kottmann <jo...@apache.org>
AuthorDate: Wed Oct 10 15:18:25 2018 +0200

    Compute ntags based on label dict size
---
 tf-ner-poc/src/main/python/namefinder/namefinder.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tf-ner-poc/src/main/python/namefinder/namefinder.py b/tf-ner-poc/src/main/python/namefinder/namefinder.py
index 8ad2335..00560ac 100644
--- a/tf-ner-poc/src/main/python/namefinder/namefinder.py
+++ b/tf-ner-poc/src/main/python/namefinder/namefinder.py
@@ -261,7 +261,7 @@ class NameFinder:
 
             labels = tf.placeholder(tf.int32, shape=[None, None], name="labels")
 
-        ntags = 7; # TODO: Compute this and not hard code
+        ntags = len(self.label_dict)
 
         W = tf.get_variable("W", shape=[2*hidden_size, ntags], dtype=tf.float32)
         b = tf.get_variable("b", shape=[ntags], dtype=tf.float32, initializer=tf.zeros_initializer())