ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1770283 - in /ctakes/trunk/ctakes-temporal/scripts/nn: classify.sh cnn_train_hybrid.py lstm_classify_hybrid.py lstm_train_hybrid.py train.sh
Date Thu, 17 Nov 2016 21:55:31 GMT
Author: dligach
Date: Thu Nov 17 21:55:31 2016
New Revision: 1770283

URL: http://svn.apache.org/viewvc?rev=1770283&view=rev
Log:
working version for event-time lstm pos+token 

Modified:
    ctakes/trunk/ctakes-temporal/scripts/nn/classify.sh
    ctakes/trunk/ctakes-temporal/scripts/nn/cnn_train_hybrid.py
    ctakes/trunk/ctakes-temporal/scripts/nn/lstm_classify_hybrid.py
    ctakes/trunk/ctakes-temporal/scripts/nn/lstm_train_hybrid.py
    ctakes/trunk/ctakes-temporal/scripts/nn/train.sh

Modified: ctakes/trunk/ctakes-temporal/scripts/nn/classify.sh
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/scripts/nn/classify.sh?rev=1770283&r1=1770282&r2=1770283&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/scripts/nn/classify.sh (original)
+++ ctakes/trunk/ctakes-temporal/scripts/nn/classify.sh Thu Nov 17 21:55:31 2016
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 source $(dirname $0)/env/bin/activate
-python $(dirname $0)/cnn_classify_hybrid.py $*
+python $(dirname $0)/lstm_classify_hybrid.py $*
 ret=$?
 deactivate
 exit $ret

Modified: ctakes/trunk/ctakes-temporal/scripts/nn/cnn_train_hybrid.py
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/scripts/nn/cnn_train_hybrid.py?rev=1770283&r1=1770282&r2=1770283&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/scripts/nn/cnn_train_hybrid.py (original)
+++ ctakes/trunk/ctakes-temporal/scripts/nn/cnn_train_hybrid.py Thu Nov 17 21:55:31 2016
@@ -69,7 +69,7 @@ def main(args):
 
     for filter_len in '2,3,4,5'.split(','):
         branch = Sequential()
-        branch.add(Embedding(len(provider.word2int),
+        branch.add(Embedding(len(provider.tag2int),
                              300,
                              input_length=maxlen,
                              weights=None))

Modified: ctakes/trunk/ctakes-temporal/scripts/nn/lstm_classify_hybrid.py
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/scripts/nn/lstm_classify_hybrid.py?rev=1770283&r1=1770282&r2=1770283&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/scripts/nn/lstm_classify_hybrid.py (original)
+++ ctakes/trunk/ctakes-temporal/scripts/nn/lstm_classify_hybrid.py Thu Nov 17 21:55:31 2016
@@ -14,7 +14,7 @@ def main(args):
         sys.exit(-1)
     working_dir = args[0]
 
-    target_dir = 'ctakes-temporal/target/eval/thyme/train_and_test/event-event/'
+    target_dir = 'ctakes-temporal/target/eval/thyme/train_and_test/event-time/'
     model_dir = os.path.join(os.environ['CTAKES_ROOT'], target_dir)
     maxlen   = pickle.load(open(os.path.join(model_dir, "maxlen.p"), "rb"))
     word2int = pickle.load(open(os.path.join(model_dir, "word2int.p"), "rb"))
@@ -59,7 +59,7 @@ def main(args):
 
             test_xs = []
             test_xs.append(test_x1)
-            test_xs.append(test_x1)
+            test_xs.append(test_x2)
 
             out = model.predict(test_xs, batch_size=50)[0]
 

Modified: ctakes/trunk/ctakes-temporal/scripts/nn/lstm_train_hybrid.py
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/scripts/nn/lstm_train_hybrid.py?rev=1770283&r1=1770282&r2=1770283&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/scripts/nn/lstm_train_hybrid.py (original)
+++ ctakes/trunk/ctakes-temporal/scripts/nn/lstm_train_hybrid.py Thu Nov 17 21:55:31 2016
@@ -85,7 +85,7 @@ def main(args):
                   metrics=['accuracy'])
     model.fit(train_xs,
               train_y,
-              nb_epoch=3,
+              nb_epoch=25,
               batch_size=50,
               verbose=0,
               validation_split=0.1)

Modified: ctakes/trunk/ctakes-temporal/scripts/nn/train.sh
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/scripts/nn/train.sh?rev=1770283&r1=1770282&r2=1770283&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/scripts/nn/train.sh (original)
+++ ctakes/trunk/ctakes-temporal/scripts/nn/train.sh Thu Nov 17 21:55:31 2016
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 source $(dirname $0)/env/bin/activate
-python $(dirname $0)/cnn_train_hybrid.py $*
+python $(dirname $0)/lstm_train_hybrid.py $*
 ret=$?
 deactivate
 exit $ret



Mime
View raw message