def dump_grammar():
with open(OPTS.filename) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
if OPTS.worker and row['WorkerId'] != OPTS.worker: continue
if row['AssignmentStatus'] == 'Rejected': continue
print 'HIT %s' % row['HITId']
print 'WorkerId: %s' % row['WorkerId']
print 'Time: %s s' % row['WorkTimeInSeconds']
input_qids = row['Input.qids'].split('\t')
input_sents = row['Input.sents'].split('\t')
ans_is_good = row['Answer.is-good'].split('\t')
ans_responses = row['Answer.responses'].split('\t')
for qid, s, is_good, response in zip(input_qids, input_sents,
ans_is_good, ans_responses):
print (' Example %s' % qid)
print (' Sentence: %s' % s).encode('utf-8')
print (' Is good? %s' % is_good)
print (' Response: %s' % colored(response, 'cyan')).encode('utf-8')
评论列表
文章目录