Exemple #1
0
def main(qa_path, relations_filepath, data_directory, batch_size,
         must_choose_answer, device, trained_to_reject, error_path):
    runner = QARunner(qa_path, relations_filepath, data_directory, batch_size,
                      must_choose_answer, device, trained_to_reject)
    em, f1, per_relation_metrics = runner.predict()
    save_se_list(runner.se_list, error_path)
    return {'em': em, 'f1': f1, 'per_relation_metrics': per_relation_metrics}
Exemple #2
0
def main(relations_filepath, data_directory, must_choose_answer, error_path,
         calculate_single_error):
    runner = BidafRunner(relations_filepath, data_directory,
                         must_choose_answer, calculate_single_error)
    em, f1, per_relation_metrics = runner.predict()
    save_se_list(runner.se_list, error_path)
    return {'em': em, 'f1': f1, 'per_relation_metrics': per_relation_metrics}