def get_aspects(labels):
    """
    Get aspect expressions from a label sequence

    Parameters
    ----------
    labels: ATE labels (list).
    
    Returns
    -------
    List of aspect expression
    """
    aspects = []
    curr_aspect = []
    prev_label = ''
    
    for i in range(len(labels)):
        if labels[i] == 'B-ASPECT':
            if 'ASPECT' in prev_label:
                aspects.append(curr_aspect)
                curr_aspect = []
            curr_aspect.append(i)
        elif labels[i] == 'I-ASPECT' and ('ASPECT' in prev_label):
            curr_aspect.append(i)
        else: # 'O'
            if curr_aspect:
                aspects.append(curr_aspect)
                curr_aspect = []
        prev_label = labels[i]
    
    if 'ASPECT' in prev_label:
        aspects.append(curr_aspect)

    return aspects