(fileName, num_class, vocab, tag_vocab, num_steps)
return label_matrix, sentLen, data_matrix
Make data set from list of which have element structed as ([1, 3, 4], [word1, word2])

    Args:
        label2text: a list of tuple with structure of ([1, 3, 4], [word1, word2])
        num_class: number of classes
        vocab: vocabulary
        num_steps: pad to num_steps 

    Returns:
        label_matrix: a list of label tuple structed as ((0, 1, 0, 1, 0, 0, ..), ...)
        data_matrix : a list of data item. **note - item in data_matrix 
                        should correspond to item label_matrix
Make data set from list of which have element structed as ([1, 3, 4], [word1, word2])
Make data set from list of which have element structed as ( [ 1 3 4 ] [ word1 word2 ] )
def mkDataSet(fileName, num_class, vocab, tag_vocab, num_steps):
    """
    Make data set from list of which have element structed as ([1, 3, 4], [word1, word2])

    Args:
        label2text: a list of tuple with structure of ([1, 3, 4], [word1, word2])
        num_class: number of classes
        vocab: vocabulary
        num_steps: pad to num_steps 

    Returns:
        label_matrix: a list of label tuple structed as ((0, 1, 0, 1, 0, 0, ..), ...)
        data_matrix : a list of data item. **note - item in data_matrix 
                        should correspond to item label_matrix
    """
    def loadData(fileName):
        label2text = []
        with open(fileName, 'rb') as fd:
            for line in fd:
                line_uni = line.decode('utf-8')
                idTag = line_uni.split('\t')
                labels = idTag[0].split('|')
                text = ' '.join(idTag[1:]).split()
                label2text.append((labels, text))
        return label2text
    
    label2text = loadData(fileName)
    label_matrix = []
    data_matrix = []
    for (labels, text) in label2text:
        label_vec = [0]* num_class
        for label in labels:
            label_vec[tag_vocab.encode(label)]=1
        label_matrix.append(label_vec)
        data_matrix.append(text)
    sentLen, data_matrix = encodeNpad(data_matrix, vocab, num_steps)
    return label_matrix, sentLen, data_matrix
def mkDataSet ( fileName , num_class , vocab , tag_vocab , num_steps ) : def loadData ( fileName ) : label2text = [ ] with open ( fileName , 'rb' ) as fd : for line in fd : line_uni = line . decode ( 'utf-8' ) idTag = line_uni . split ( '\t' ) labels = idTag [ 0 ] . split ( '|' ) text = ' ' . join ( idTag [ 1 : ] ) . split ( ) label2text . append ( ( labels , text ) ) return label2text label2text = loadData ( fileName ) label_matrix = [ ] data_matrix = [ ] for ( labels , text ) in label2text : label_vec = [ 0 ] * num_class for label in labels : label_vec [ tag_vocab . encode ( label ) ] = 1 label_matrix . append ( label_vec ) data_matrix . append ( text ) sentLen , data_matrix = encodeNpad ( data_matrix , vocab , num_steps ) return label_matrix , sentLen , data_matrix