bert_max_doc_str_max_str_pos_clean_doc_noise_doc/run_doc_qa.py
def read_doc_squad_examples_from_generator(input_file, is_training):
    """Read a SQuAD json file into a list of DocSquadExample."""
    examples = read_squad_examples_from_generator(input_file, is_training)

    keyfunc = lambda x: x.qid

    # Groups the example by qid.
    doc_examples = [
        _DocSquadExample(qid=qid, example_list=list(group))
        for qid, group in itertools.groupby(
            sorted(examples, key=keyfunc), key=keyfunc)
    ]

    return doc_examples
Read a SQuAD json file into a list of DocSquadExample.
Read a SQuAD json file into a list of DocSquadExample.
Read a SQuAD json file into a list of DocSquadExample .
def read_doc_squad_examples_from_generator(input_file, is_training):
    examples = read_squad_examples_from_generator(input_file, is_training)
    keyfunc = lambda x: x.qid
    doc_examples = [
        _DocSquadExample(qid=qid, example_list=list(group))
        for qid, group in itertools.groupby(
            sorted(examples, key=keyfunc), key=keyfunc)
    ]
    return doc_examples
def read_doc_squad_examples_from_generator ( input_file , is_training ) : examples = read_squad_examples_from_generator ( input_file , is_training ) keyfunc = lambda x : x . qid doc_examples = [ _DocSquadExample ( qid = qid , example_list = list ( group ) ) for qid , group in itertools . groupby ( sorted ( examples , key = keyfunc ) , key = keyfunc ) ] return doc_examples
Read a SQuAD json file into a list of DocSquadExample.
Read a SQuAD json file into a list of DocSquadExample .
"""Read a SQuAD json file into a list of DocSquadExample.""" # Groups the example by qid.
input_file
is_training