import json


def load_perf_file(epitca_perf_file):
    """
    This loads the Epitca performance data.

    :returns: a dictionary where the keys are the questions asked and values
    """
    data = {}
    with open(epitca_perf_file, 'r') as f:
        data = json.load(f)

    epitca_perf_dict = {}

    for expected_answer_group in data:
        for question in expected_answer_group["epitca"]:
            epitca_perf_dict[question["question"]] = \
                    [result["document"]["id"] for result in question["result"]]

    return epitca_perf_dict