def dataset_to_seq_target_format(data):
    """Convert a list of sequences to (seq,target) format.

    Args:
        data (pandas.DataFrame): The dataset to be transformed.

    Returns:
        out_seqs (List): Context sequence.
        labs (List): Labels of the context sequence, each element is the last item in the origin sequence.
    """
    iseqs = data["col_sequence"]

    out_seqs = []
    labs = []
    ids = []
    for id, seq in zip(range(len(iseqs)), iseqs):
        for i in range(1, len(seq)):
            tar = seq[-i]
            labs += [tar]
            out_seqs += [seq[:-i]]
            ids += [id]
    return out_seqs, labs