import ast


def get_cue(series):
    """Extract cues using the cue indices from the sentence.
    """
    # The data is a string that should be a list of integers
    cues = ast.literal_eval(series["cues_idx"])
    # Extract all cue words.
    cue = [s for c, s in zip(cues, series["sent"].split(" ")) if c]

    if len(cue) == 1:
        return cue[0]
    elif len(cue) == 0:
        return None
    else:
        return cue