openstt-uk / scripts /add_len2dur_field.py
Yehor Smoliakov
Add len2dur
0e772c5
raw
history blame
289 Bytes
from os.path import dirname
import json
filename = dirname(__file__) + '/../voa/train.jsonl'
with open(filename, 'r') as f:
for line in f:
data = json.loads(line)
data['len2dur'] = round(data['length'] / data['duration'], 3)
print(json.dumps(data))