import pickle


def load_ranks_from_file(filename):
    """
    Given a pickled rank file, returns ranks and inverse_ranks.
    """
    with open(filename, 'rb') as f:
        content = pickle.load(f)

    return content['ranks'], content['inverse_ranks']