util2.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:code-uai16 作者: thanhan 项目源码 文件源码
def read_turk_dic_proton():
    """
    dic of abs_id to answers to (wid, q3,q4) for each worker
    """
    f = open("data/proton-beam-RawTurkResults.csv")

    first_line = f.readline()

    csv_reader = csv.reader(f)

    turk_dic = {}
    for row in csv_reader:        
        (AssignmentId, WorkerId, HITId, AcceptTime, SubmitTime, ApprovalTime, TimeToComplete, AbstractId, Question1, Question2, Question3, Question4, Relevant) = tuple(row)
        AbstractId = int(AbstractId)
        if AbstractId not in turk_dic: turk_dic[AbstractId] = []
        turk_dic[AbstractId].append( (Question3, Question4) )

    return turk_dic
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号