def split_input_target(chunk):
    """
    Creates input/target pairs for text generation: sequence up to second-to-last element and
    sequence from second element to last.
    """
    input_text = chunk[:-1]
    target_text = chunk[1:]
    return input_text, target_text