def get_F1_EM(dataset, predict_data):
f1 = exact_match = total = <NUM_LIT:0><EOL>for record in dataset:<EOL><INDENT>total += <NUM_LIT:1><EOL>if record[<NUM_LIT:1>] not in predict_data:<EOL><INDENT>message = '<STR_LIT>' + record[<NUM_LIT:1>] +'<STR_LIT>'<EOL>print(message)<EOL>continue<EOL><DEDENT>ground_truths = record[<NUM_LIT:4>]<EOL>prediction = predict_data[record[<NUM_LIT:1>]]<EOL>exact_match += metric_max_over_ground_truths(<EOL>exact_match_score, prediction, ground_truths)<EOL>f1 += metric_max_over_ground_truths(f1_score, prediction,<EOL>ground_truths)<EOL><DEDENT>exact_match = <NUM_LIT> * exact_match / total<EOL>f1 = <NUM_LIT> * f1 / total<EOL>scores = {'<STR_LIT>': exact_match, '<STR_LIT>': f1}<EOL>return scores<EOL>
Calculate the F1 and EM scores of the predicted results.
    Use only with the SQuAD1.1 dataset.

    Parameters
    ----------
    dataset_file: string
        Path to the data file.
    predict_data: dict
        All final predictions.

    Returns
    -------
    scores: dict
        F1 and EM scores.