def strip_BOS_EOS_tokens(tokens, labels):
    """
    Removes the BOS and EOS tokens and their corresponding O label.

    strip_BOS_EOS_tokens('BOS text . . . text EOS', 'O X . . . X O')
    > 'text . . . text', 'X . . . X'
    """

    new_tokens = [' '.join(x.split(' ')[1:-1]).strip() for x in tokens]
    new_labels = [' '.join(x.split(' ')[1:-1]).strip() for x in labels]

    return new_tokens, new_labels