def _run(self):
with tf.Session() as session:
self.io.restore_session(session)
inputs = sys.stdin
singsen = SingleSentenceData()
scounter = SpeedCounter().start()
while True:
senlen = singsen.read_from_file(sys.stdin, self.io.w2id)
if senlen is None:
break
if senlen < 2:
print(-9999)
continue
o = run_epoch(session, self.test_model, singsen)
scounter.next()
if self.params.progress and scounter.val % 20 ==0:
print("\rLoglikes per secs: %f" % scounter.speed, end="", file=sys.stderr)
print("%f" % o)
评论列表
文章目录