import json


def load_system_output(filename):
    """Loads the system's predicted output from a JSON file."""
    print('Loading system predictions from {}... '.format(filename))
    system_output = {}
    with open(filename, 'r') as json_file:
        data = json.load(json_file)
        for answer in data:
            system_output[answer['id']] = {
                'category': answer['category'],
                'type': answer['type']
            }
    print('   {} predictions loaded'.format(len(system_output)))
    return system_output