import csv


def _read_file_to_dict(path):
    """
    Load the problems and the corresponding labels from the *.txt file.
    :param path: The full path to the file to read
    :return: The dictionary with the problem names as keys and the true class labels as values
    """
    label_dict = {}
    with open(path, 'r', encoding='utf-8-sig') as truth_file:
        truth = csv.reader(truth_file, delimiter=' ')
        for problem in truth:
            label_dict[problem[0]] = problem[1]
        return label_dict