def get_invalid_labels(labels, valid_labels):
    """
    Returns a dictionary whose keys are words in labels that are not in valid_labels.
    The values of the dictionary are the corresponding indices of the invalid words in labels.

    Args:
        labels: a list of labels
        valid_labels: a list of valid labels.

    Returns:
        a dictionary
    """
    return {word: idx for (idx, word) in enumerate(labels) if word not in valid_labels}