基于人工反馈的机器学习系统搭建与实践
1. 构建获取人工标签的接口
在处理数据标注时,我们需要一个接口来获取人工标签。以下是相关代码逻辑:
ind-=1 # go back
elif label == "d":
print(detailed_instructions) # print detailed instructions
elif label == "s":
break # save and exit
else:
if not label == "1":
label = "0" # treat everything other than 1 as 0
data[ind][2] = label # add label to our data
if data[ind][3] is None or data[ind][3] == "":
data[ind][3] = default_sampling_strategy # default if none given
ind+=1
else:
#last one - give annotator a chance to go back
print(last_instruction)
label = str(input("\n\n> "))
if label == "2":
ind-=1
else:
ind+=1
return data
超级会员免费看
订阅专栏 解锁全文
2525

被折叠的 条评论
为什么被折叠?



