[fix] fix evaluate squad useless code
@@ -91,25 +91,3 @@ def evaluate(dataset, predictions):
f1 = 100.0 * f1 / total
return {'exact_match': exact_match, 'f1': f1}
-
-
-if __name__ == '__main__':
- expected_version = '1.1'
- parser = argparse.ArgumentParser(
- description='Evaluation for SQuAD ' + expected_version)
- parser.add_argument('dataset_file', help='Dataset file')
- parser.add_argument('prediction_file', help='Prediction File')
- args = parser.parse_args()
-
- with open(args.dataset_file) as dataset_file:
- dataset_json = json.load(dataset_file)
- if (dataset_json['version'] != expected_version):
- print('Evaluation expects v-' + expected_version +
- ', but got dataset with v-' + dataset_json['version'],
- file=sys.stderr)
- dataset = dataset_json['data']
-
- with open(args.prediction_file) as prediction_file:
- predictions = json.load(prediction_file)
- print(json.dumps(evaluate(dataset, predictions)))
-
