Utility functions for Squad Results

class EVAL_OPTS[source]

EVAL_OPTS(data_file, pred_file, out_file='', na_prob_file='na_prob.json', na_prob_thresh=1.0, out_image_dir=None, verbose=False)

parse_args[source]

parse_args()

make_qid_to_has_ans[source]

make_qid_to_has_ans(dataset)

normalize_answer[source]

normalize_answer(s)

Lower text and remove punctuation, articles and extra whitespace.

get_tokens[source]

get_tokens(s)

compute_exact[source]

compute_exact(a_gold, a_pred)

compute_f1[source]

compute_f1(a_gold, a_pred)

get_raw_scores[source]

get_raw_scores(dataset, preds)

apply_no_ans_threshold[source]

apply_no_ans_threshold(scores, na_probs, qid_to_has_ans, na_prob_thresh)

make_eval_dict[source]

make_eval_dict(exact_scores, f1_scores, qid_list=None)

merge_eval[source]

merge_eval(main_eval, new_eval, prefix)

plot_pr_curve[source]

plot_pr_curve(precisions, recalls, out_image, title)

make_precision_recall_eval[source]

make_precision_recall_eval(scores, na_probs, num_true_pos, qid_to_has_ans, out_image=None, title=None)

run_precision_recall_analysis[source]

run_precision_recall_analysis(main_eval, exact_raw, f1_raw, na_probs, qid_to_has_ans, out_image_dir)

histogram_na_prob[source]

histogram_na_prob(na_probs, qid_list, image_dir, name)

find_best_thresh[source]

find_best_thresh(preds, scores, na_probs, qid_to_has_ans)

find_best_thresh_v2[source]

find_best_thresh_v2(preds, scores, na_probs, qid_to_has_ans)

find_all_best_thresh[source]

find_all_best_thresh(main_eval, preds, exact_raw, f1_raw, na_probs, qid_to_has_ans)

find_all_best_thresh_v2[source]

find_all_best_thresh_v2(main_eval, preds, exact_raw, f1_raw, na_probs, qid_to_has_ans)

main[source]

main(OPTS)