(lines)
| 77 | return all_ans |
| 78 | |
| 79 | def parse(lines): |
| 80 | all_ans = [] |
| 81 | for line in lines: |
| 82 | try: |
| 83 | ans = extract_answer_wizard(json.loads(line)[0][1]) |
| 84 | except BaseException: |
| 85 | ans = extract_answer_wizard(json.loads(line)['gen'][0]) |
| 86 | all_ans.append(ans) |
| 87 | return all_ans |
| 88 | |
| 89 | def eval_json(json_path, mode='test'): |
| 90 | if json_path.endswith('/') or not json_path.endswith('json'): |
no test coverage detected