Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
F = np.zeros((len(d2_list), config['feat_size']), dtype=np.float32)
X1[:] = config['fill_word']
X2[:] = config['fill_word']
d1_len = min(config['data1_maxlen'], len(data1[d1]))
for j, (l, d2) in enumerate(d2_list):
d2_len = min(config['data2_maxlen'], len(data2[d2]))
X1[j, :d1_len], X1_len[j] = data1[d1][:d1_len], d1_len
X2[j, :d2_len], X2_len[j] = data2[d2][:d2_len], d2_len
Y[j] = l
X1_id[j], X2_id[j] = d1, d2
#F[j] = features[(d1, d2)]
yield X1, X1_len, X1_id, X2, X2_len, X2_id, Y, F
if __name__ == '__main__':
loader = DataLoader('./config/letor07_mp_fold1.model')