ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1761803 - /ctakes/trunk/ctakes-temporal/scripts/nn/predict.py
Date Wed, 21 Sep 2016 19:47:49 GMT
Author: dligach
Date: Wed Sep 21 19:47:49 2016
New Revision: 1761803

URL: http://svn.apache.org/viewvc?rev=1761803&view=rev
Log:
using 'none' for now to represent oov items

Modified:
    ctakes/trunk/ctakes-temporal/scripts/nn/predict.py

Modified: ctakes/trunk/ctakes-temporal/scripts/nn/predict.py
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/scripts/nn/predict.py?rev=1761803&r1=1761802&r2=1761803&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/scripts/nn/predict.py (original)
+++ ctakes/trunk/ctakes-temporal/scripts/nn/predict.py Wed Sep 21 19:47:49 2016
@@ -34,10 +34,11 @@ def main(args):
 
             feats=[]
             for unigram in line.rstrip().split():
-                if(unigram in word2int):
+                if unigram in word2int:
                     feats.append(word2int[unigram])
                 else:
-                    feats.append(word2int['oov_word'])
+                    # TODO: 'none' is not in vocabulary!
+                    feats.append(word2int['none'])
                     
             if len(feats) > maxlen:
                 feats=feats[0:maxlen]



Mime
View raw message