import json


def load_mapping(filename):
    """
    Load mapping dict from file.

    :param filename: mapping file name
    :return: dictionary of key to one-hot encoding; number of keys
    """
    f = open(filename)
    mapping = json.load(f)
    return mapping, len(mapping)