Skip to content

Commit

Permalink
Commented multi retrain lines in w2v.py
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosgo committed Jun 8, 2016
1 parent a566d6f commit d0a889c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nohup.out
50 changes: 50 additions & 0 deletions nohup.out
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,53 @@ OSError: [Errno 21] Is a directory: '/almac/ignacio/nlp-pipeline/blocked'
>> [2016-06-07 14:38:31] Model successfully loaded...

>> [2016-06-07 14:38:31] Articles generator unpacking...

>> [2016-06-07 14:42:48] Model successfully loaded...

>> [2016-06-07 14:42:48] Articles generator unpacking...

>> [2016-06-07 15:48:52] Articles generator unpacked... Training begins.

>> [2016-06-07 16:03:54] Model successfully trained...
Traceback (most recent call last):
File "w2v.py", line 154, in <module>
while(exists("%s/blocked" % getcwd()) and to < trials):
NameError: name 'trials' is not defined

>> [2016-06-07 16:40:20] Model successfully loaded...

>> [2016-06-07 16:40:20] Articles generator unpacking...

>> [2016-06-07 17:44:53] Articles generator unpacked... Training begins.

>> [2016-06-07 17:59:46] Model successfully trained...

>> [2016-06-07 18:00:30] Model successfully saved...

>> [2016-06-07 18:00:30] Successful reload and Finished !!

>> [2016-06-08 01:38:52] Model successfully loaded...

>> [2016-06-08 01:38:52] Articles generator unpacking...

>> [2016-06-08 02:45:13] Articles generator unpacked... Training begins.

>> [2016-06-08 03:06:18] Model successfully trained...

>> [2016-06-08 03:07:02] Model successfully saved...

>> [2016-06-08 03:07:02] Successful reload and Finished !!

>> [2016-06-08 07:16:19] Articles generator unpacking...

>> [2016-06-08 08:30:08] Articles generator unpacked... Training begins.

>> [2016-06-08 08:51:53] Model successfully trained...

>> [2016-06-08 08:52:44] Model successfully saved...

>> [2016-06-08 08:53:09] Successful reload and Finished !!

>> [2016-06-08 09:14:04] Model successfully loaded...

>> [2016-06-08 09:14:04] Articles generator unpacking...
18 changes: 9 additions & 9 deletions w2v.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ def __iter__(self):
d2v_model.train(articles)
sys.stderr.write("\n>> [%s] Model successfully trained...\n" % (strftime("%Y-%m-%d %H:%M:%S", localtime())))

to = 0
while(exists("%s/blocked" % getcwd()) and to < trials):
if to > 0: sleep(1)
to += 1
if not to < trials:
sys.stderr.write("\n>> [%s] ERROR -- Unlearned: %s...\n" % (strftime("%Y-%m-%d %H:%M:%S", localtime()),args.indir_file_name))
exit()
#to = 0
#while(exists("%s/blocked" % getcwd()) and to < trials):
# if to > 0: sleep(1)
# to += 1
#if not to < trials:
# sys.stderr.write("\n>> [%s] ERROR -- Unlearned: %s...\n" % (strftime("%Y-%m-%d %H:%M:%S", localtime()),args.indir_file_name))
# exit()

makedirs("%s/blocked" % getcwd())
#makedirs("%s/blocked" % getcwd())
d2v_model.save(args.outfile, separately = None)
remove("%s/blocked" % getcwd())
#remove("%s/blocked" % getcwd())

sys.stderr.write("\n>> [%s] Model successfully saved...\n" % (strftime("%Y-%m-%d %H:%M:%S", localtime())))
except IOError:
Expand Down

0 comments on commit d0a889c

Please sign in to comment.