Skip to content

Instantly share code, notes, and snippets.

@nihemak
Last active December 5, 2016 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nihemak/c3d3d816be8691289874808c4ad3b835 to your computer and use it in GitHub Desktop.
Save nihemak/c3d3d816be8691289874808c4ad3b835 to your computer and use it in GitHub Desktop.
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)))
@nihemak
Copy link
Author

nihemak commented Dec 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment