Official evaluation script for v1.1 of the SQuAD dataset. [Changed name for external importing]
actableai.third_parties.spanABSA.squad.squad_evaluate.evaluate(dataset, predictions)¶actableai.third_parties.spanABSA.squad.squad_evaluate.exact_match_score(prediction, ground_truth)¶actableai.third_parties.spanABSA.squad.squad_evaluate.f1_score(prediction, ground_truth)¶actableai.third_parties.spanABSA.squad.squad_evaluate.merge_eval(main_eval, new_eval)¶actableai.third_parties.spanABSA.squad.squad_evaluate.metric_max_over_ground_truths(metric_fn, prediction, ground_truths)¶actableai.third_parties.spanABSA.squad.squad_evaluate.normalize_answer(s)¶Lower text and remove punctuation, articles and extra whitespace.
actableai.third_parties.spanABSA.squad.squad_evaluate.span_f1(true_span, pred_span)¶actableai.third_parties.spanABSA.squad.squad_evaluate.span_len(span)¶actableai.third_parties.spanABSA.squad.squad_evaluate.span_overlap(s1, s2)¶actableai.third_parties.spanABSA.squad.squad_evaluate.span_prec(true_span, pred_span)¶actableai.third_parties.spanABSA.squad.squad_evaluate.span_recall(true_span, pred_span)¶actableai.third_parties.spanABSA.squad.squad_utils.InputFeatures(unique_id, example_index, doc_span_index, tokens, token_to_orig_map, token_is_max_context, input_ids, input_mask, segment_ids, start_position=None, end_position=None)¶Bases: object
A single set of features of data.
actableai.third_parties.spanABSA.squad.squad_utils.RawResult(unique_id, start_logits, end_logits)¶Bases: tuple
end_logits¶Alias for field number 2
start_logits¶Alias for field number 1
unique_id¶Alias for field number 0
actableai.third_parties.spanABSA.squad.squad_utils.SquadExample(qas_id, question_text, doc_tokens, orig_answer_text=None, start_position=None, end_position=None)¶Bases: object
A single training/test example for simple sequence classification.
actableai.third_parties.spanABSA.squad.squad_utils.convert_examples_to_features(examples, tokenizer, max_seq_length, doc_stride, max_query_length, is_training, verbose_logging=False, logger=None)¶Loads a data file into a list of `InputBatch`s.
actableai.third_parties.spanABSA.squad.squad_utils.get_final_text(pred_text, orig_text, do_lower_case, verbose_logging=False, logger=None)¶Project the tokenized prediction back to the original text.
actableai.third_parties.spanABSA.squad.squad_utils.read_squad_examples(input_file, is_training, logger)¶Read a SQuAD json file into a list of SquadExample.
actableai.third_parties.spanABSA.squad.squad_utils.write_predictions(all_examples, all_features, all_results, n_best_size, max_answer_length, do_lower_case, do_max_context, verbose_logging, logger)¶Write final predictions to the json file.