Exemplo n.º 1
0
def get_batch_data(x,
                   y,
                   sen_len,
                   doc_len,
                   word_dis,
                   keep_prob1,
                   keep_prob2,
                   batch_size,
                   test=False):
    if y == None:
        for index in func.batch_index(len(word_dis), batch_size, test):
            feed_list = [
                x[index], sen_len[index], doc_len[index], word_dis[index],
                keep_prob1, keep_prob2
            ]
            yield feed_list, len(index)
    else:
        for index in func.batch_index(len(y), batch_size, test):
            feed_list = [
                x[index], y[index], sen_len[index], doc_len[index],
                word_dis[index], keep_prob1, keep_prob2
            ]
            yield feed_list, len(index)
Exemplo n.º 2
0
def get_batch_data(x,
                   sen_len,
                   doc_len,
                   keep_prob1,
                   keep_prob2,
                   y,
                   batch_size,
                   test=False):
    for index in func.batch_index(len(y), batch_size, test):
        feed_list = [
            x[index], sen_len[index], doc_len[index], keep_prob1, keep_prob2,
            y[index]
        ]
        yield feed_list, len(index)
Exemplo n.º 3
0
Arquivo: ecjc.py Projeto: LeMei/ecjd
def get_cause_batch_data(x,
                         y_cause,
                         sen_len,
                         doc_len,
                         clause_pos,
                         keep_prob1,
                         keep_prob2,
                         batch_size,
                         test=False):
    for index in func.batch_index(len(y_cause), batch_size, test):
        feed_list = [
            x[index], y_cause[index], sen_len[index], doc_len[index],
            clause_pos[index], keep_prob1, keep_prob2
        ]
        yield feed_list, len(index)
Exemplo n.º 4
0
def get_batch_data(x,
                   sen_len,
                   doc_len,
                   keep_prob1,
                   keep_prob2,
                   y_position,
                   y_cause,
                   batch_size,
                   test=False):
    for index in batch_index(len(y_cause), batch_size, test):
        feed_list = [
            x[index], sen_len[index], doc_len[index], keep_prob1, keep_prob2,
            y_position[index], y_cause[index]
        ]
        yield feed_list, len(index)