def filter_labels(sent: Sequence[str], labels: Set[str] = None) -> List[str]:
    """ Returns only the tokens present in the sentence that are in labels."""

    if labels:
        return [tok for tok in sent if tok in labels]
    return list(sent)
Returns only the tokens present in the sentence that are in labels.