def append_terminal_token(dataset, terminal_token='<e>'):
    """Appends end-of-sequence token to each sequence.
    :param dataset - a 2-d array, contains sequences of tokens.
    :param terminal_token (Optional) which symbol to append.
    """
    return [sample + [terminal_token] for sample in dataset]