def scores_to_ranks(scores):
    """Convert model output scores into ranks."""
    assert len(scores) == 100 and isinstance(scores, list)
    ranks = [0] * 100
    ranks_id = sorted(range(len(scores)), key=lambda k: scores[k], reverse=True)
    for idx in range(100):
        ranks[ranks_id[idx]] = idx
    ranks = [r + 1 for r in ranks]
    return ranks