← 返回题库
初级

统计OCR错误类型分布

未完成
初级参考 完整示例代码供参考,建议自己理解后重新输入
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    errors = pd.read_csv(StringIO(open_url("https://data.zuihe.com/dbd/ms-ledger/state_01/ocr_errors.csv").read()))
    print(f"Total errors: {len(errors)}")
    for etype, grp in errors.groupby('error_type'):
        resolved = int(grp['resolved'].sum())
        print(f"  {etype}: count={len(grp)} resolved={resolved} rate={round(resolved/len(grp)*100,1)}%")
    print(f"Overall resolved: {int(errors['resolved'].sum())}/{len(errors)}")

示例

输入
solve()
期望输出
Total errors: 105
  image_blurry: count=28 resolved=14 rate=50.0%
  low_confidence: count=18 resolved=9 rate=50.0%
  missing_amount: count=18 resolved=8 rate=44.4%
  missing_date: count=21 resolved=11 rate=52.4%
  partial_text: count=20 resolved=15 rate=75.0%
Overall resolved: 57/105
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码