def getDataSentiment(batch):
g1 = []
g1_pos = []
for i in batch:
g1.append(i[0].embeddings)
g1_pos.append(i[0].pos_embeddings)
g1x, g1x_pos = prepare_data(g1,g1_pos)
scores = []
for i in batch:
temp = np.zeros(2)
label = i[1].strip()
if label == "0":
temp[0]=1
if label == "1":
temp[1]=1
scores.append(temp)
scores = np.matrix(scores)+0.000001
scores = np.asarray(scores,dtype=config.floatX)
return (scores,g1x,g1x_pos)
utils.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录