Last active
December 5, 2016 23:50
-
-
Save nihemak/c3d3d816be8691289874808c4ad3b835 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Translator import Translator | |
# 英日翻訳のテスト | |
en_lines = open('en-test.txt').read().split('\n') | |
epoch_num = 100 | |
for epoch in range(epoch_num): | |
model = Translator() | |
modelfile = "en2ja-" + str(epoch) + ".model" | |
model.load_model(modelfile) | |
for i in range(len(en_lines)-1): | |
en_words = en_lines[i].lower().split() | |
ja_words = model.test(en_words) | |
print("{0}: {1}".format(epoch, ' '.join(ja_words))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://nihemak.hatenablog.com/entry/2016/12/06/010550