def submitFormat():
f=open('daguan_bilstmcrf_result.txt')
labels=f.readlines()
f.close()
f=open('daguan_test.txt')
texts=f.readlines()
f.close()
f=open('result_layer_3.txt','w',encoding='utf8')
for i,label in enumerate(labels):
label=label.strip().split(' ')
text=texts[i].strip().split('_')
print(len(label),len(text))
length=len(label)
start=0
end=0
result=[]
print(i,label)
while length>0:
if label[end] == 'o':
while label[end] == 'o':
end+=1
length-=1
if length==0:
break
result.append('_'.join(text[start:end])+'/o')
start=end
深度学习模型训练输出后生成对应格式的tag列表
最新推荐文章于 2024-06-04 09:14:03 发布