(task_name, args)
| 46 | |
| 47 | |
| 48 | def get_output_func(task_name, args): |
| 49 | def default_output_func(predictions, examples, output_file): |
| 50 | with open(output_file, "w") as output: |
| 51 | for prediction, example in zip(predictions, examples): |
| 52 | data = {"idx": example["idx"], "label": prediction} |
| 53 | output.write(json.dumps(data) + "\n") |
| 54 | if task_name in PROCESSORS: |
| 55 | return PROCESSORS[task_name](args).output_prediction |
| 56 | else: |
| 57 | return default_output_func |
| 58 | |
| 59 | |
| 60 | def read_tsv(path, **kwargs): |
no outgoing calls
no test coverage detected