#!/usr/bin/env python
from dictlearn.extractive_qa_training import evaluate_extractive_qa
from dictlearn.extractive_qa_configs import qa_config_registry
from dictlearn.main import main_evaluate

if __name__ == "__main__":
    main_evaluate(qa_config_registry, evaluate_extractive_qa)
Beispiel #2
0
#!/usr/bin/env python
from dictlearn.nli_training import evaluate
from dictlearn.main import main_evaluate
from dictlearn.nli_esim_config_registry import nli_esim_config_registry

from functools import partial

if __name__ == "__main__":
    main_evaluate(nli_esim_config_registry, partial(evaluate, model="esim"))
Beispiel #3
0
    print "aggregated stats:", aggregated
    print "# of parameters {}".format(n_params)

    #TODO: check that different batch_size yields same validation error than
    # end of training validation error.
    # TODO: I think blocks aggreg is simply mean which should break
    # when we use masks??? investigate

    if not os.path.exists(dest_path):
        os.makedirs(dest_path)

    if part == 'test_unseen':
        np.savez(
            os.path.join(dest_path, "predictions"),
            words=input_data['words'],
            words_mask=input_data['words_mask'],
            #unk_ratio = to_save['unk_ratio'],
            #def_unk_ratio = to_save['def_unk_ratio'],
            proba_out=to_save['languagemodel_apply_proba_out'],
            vocab_in=lm._vocab.words[:c['num_input_words']],
            vocab_out=lm._vocab.words[:c['num_output_words']])

    json.dump(aggregated,
              open(os.path.join(dest_path, "aggregates.json"), "w"),
              sort_keys=True,
              indent=2)


if __name__ == "__main__":
    main_evaluate(lm_config_registry, evaluate_lm)