import json,re,difflib,soundfile as sf from pick import asr log=json.load(open('/tmp/sqcliplog.json')) n=lambda x:re.sub(r"[^a-z ]","",x.lower().replace("’","").replace("'","").replace("-"," ").replace("6","six").replace("3","three").replace("5","five")).split() res=[] for k,(t,w) in log.items(): if k.startswith(('w:','slow:')): continue a,sr=sf.read(w,dtype='float32'); h=asr(a) r=difflib.SequenceMatcher(None,n(t),n(h)).ratio(); res.append((r,t,h)) res.sort() for r,t,h in res[:40]: print(f"{r:.2f} | {t} | {h}") print('n',len(res),'below .85:',sum(1 for r,*_ in res if r<.85))