live-lm-critic / gec /scripts /parse_m2_output.py
Olivia Figueira
Upload code with streamlit addition
b6e5241
raw
history blame
279 Bytes
#!/usr/bin/env python
import sys
import json
scores = []
for i, line in enumerate(sys.stdin):
score = line.split(':')[1].strip()
scores.append(float(score))
json.dump({'precision': scores[0], 'recall': scores[1], 'F0.5': scores[2]}, open('stats.json', 'w'), indent=2)