def test_ende(self):
     os.chdir('models/en-de/')
     with open('../../en-de/in', 'r', encoding='utf-8') as in_file, \
          open('../../en-de/references', 'r', encoding='utf-8') as ref_file, \
          open('../../en-de/out_score', 'w', encoding='utf-8') as score_file:
         settings = ScorerSettings()
         settings.models = ['model.npz']
         settings.minibatch_size = 80
         settings.normalization_alpha = 1.0
         score(in_file, ref_file, score_file, settings)
     os.chdir('../..')
     self.scoreEqual('en-de/ref_score', 'en-de/out_score')
Пример #2
0
 def get_settings():
     scorer_settings = ScorerSettings()
     scorer_settings.models = ['model.npz']
     scorer_settings.minibatch_size = 80
     scorer_settings.normalization_alpha = 1.0
     return scorer_settings