Functions | |
def | convert_doc_tokens (paragraph_text) |
def | _check_is_max_context (doc_spans, cur_span_index, position) |
def | convert_example_to_features (doc_tokens, question_text, tokenizer, max_seq_length, doc_stride, max_query_length) |
def | read_squad_json (input_file) |
def | _get_best_indexes (logits, n_best_size) |
def | get_final_text (pred_text, orig_text, do_lower_case) |
def | _compute_softmax (scores) |
def | get_predictions (doc_tokens, features, results, n_best_size, max_answer_length) |
def helpers.data_processing.convert_doc_tokens | ( | paragraph_text | ) |
Return the list of tokens from the doc text
|
private |
Check if this is the 'max context' doc span for the token.
def helpers.data_processing.convert_example_to_features | ( | doc_tokens, | |
question_text, | |||
tokenizer, | |||
max_seq_length, | |||
doc_stride, | |||
max_query_length | |||
) |
Loads a data file into a list of `InputBatch`s.
def helpers.data_processing.read_squad_json | ( | input_file | ) |
read from squad json into a list of examples
|
private |
Get the n-best logits from a list.
def helpers.data_processing.get_final_text | ( | pred_text, | |
orig_text, | |||
do_lower_case | |||
) |
Project the tokenized prediction back to the original text.
|
private |
Compute softmax probability over raw logits.
def helpers.data_processing.get_predictions | ( | doc_tokens, | |
features, | |||
results, | |||
n_best_size, | |||
max_answer_length | |||
) |