File size: 285 Bytes
b6e5241
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python

import sys
import json

for i, line in enumerate(sys.stdin):
    if i == 3:
        nums = line.split()
        P, R, F = nums[3:6]
        json.dump({'precision': float(P), 'recall': float(R), 'F0.5': float(F)}, open('stats.json', 'w'), indent=2)
        break