Commit
·
ddeaff7
1
Parent(s):
9eab0a6
add example models
Browse files- DocRepairer-XL/results.json +19 -0
- OCRFixer-Lite/results.json +19 -0
- generate_results.py +69 -0
DocRepairer-XL/results.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type_symbol": "T",
|
| 3 |
+
"model": "[DocRepairer-XL](https://huggingface.co/docrepairer-xl)",
|
| 4 |
+
"average": 0.891,
|
| 5 |
+
"Type": "seq2seq",
|
| 6 |
+
"Architecture": "T5-xl",
|
| 7 |
+
"Weight type": "fine-tuned",
|
| 8 |
+
"Num tokens": 294500,
|
| 9 |
+
"Num errors": 482,
|
| 10 |
+
"CER": 0.043,
|
| 11 |
+
"WER": 0.071,
|
| 12 |
+
"CER improvement": 0.034,
|
| 13 |
+
"WER improvement": 0.051,
|
| 14 |
+
"Hub License": "mit",
|
| 15 |
+
"#Params (B)": 3.0,
|
| 16 |
+
"Hub ❤️": 978,
|
| 17 |
+
"Available on the hub": true,
|
| 18 |
+
"Model sha": "d8a9e71"
|
| 19 |
+
}
|
OCRFixer-Lite/results.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type_symbol": "T",
|
| 3 |
+
"model": "[OCRFixer-Lite](https://huggingface.co/ocrfixer-lite)",
|
| 4 |
+
"average": 0.842,
|
| 5 |
+
"Type": "seq2seq",
|
| 6 |
+
"Architecture": "T5-small",
|
| 7 |
+
"Weight type": "fine-tuned",
|
| 8 |
+
"Num tokens": 145300,
|
| 9 |
+
"Num errors": 528,
|
| 10 |
+
"CER": 0.064,
|
| 11 |
+
"WER": 0.092,
|
| 12 |
+
"CER improvement": 0.023,
|
| 13 |
+
"WER improvement": 0.037,
|
| 14 |
+
"Hub License": "apache-2.0",
|
| 15 |
+
"#Params (B)": 0.06,
|
| 16 |
+
"Hub ❤️": 412,
|
| 17 |
+
"Available on the hub": true,
|
| 18 |
+
"Model sha": "5b3f2e1"
|
| 19 |
+
}
|
generate_results.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import json
|
| 3 |
+
import re
|
| 4 |
+
|
| 5 |
+
# Sample data (paste the JSON data from above here)
|
| 6 |
+
models_data = [
|
| 7 |
+
{
|
| 8 |
+
"model_type_symbol": "T",
|
| 9 |
+
"model": "[OCRFixer-Lite](https://huggingface.co/ocrfixer-lite)",
|
| 10 |
+
"average": 0.842,
|
| 11 |
+
"Type": "seq2seq",
|
| 12 |
+
"Architecture": "T5-small",
|
| 13 |
+
"Weight type": "fine-tuned",
|
| 14 |
+
"Num tokens": 145300,
|
| 15 |
+
"Num errors": 528,
|
| 16 |
+
"CER": 0.064,
|
| 17 |
+
"WER": 0.092,
|
| 18 |
+
"CER improvement": 0.023,
|
| 19 |
+
"WER improvement": 0.037,
|
| 20 |
+
"Hub License": "apache-2.0",
|
| 21 |
+
"#Params (B)": 0.06,
|
| 22 |
+
"Hub ❤️": 412,
|
| 23 |
+
"Available on the hub": True,
|
| 24 |
+
"Model sha": "5b3f2e1"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"model_type_symbol": "T",
|
| 28 |
+
"model": "[DocRepairer-XL](https://huggingface.co/docrepairer-xl)",
|
| 29 |
+
"average": 0.891,
|
| 30 |
+
"Type": "seq2seq",
|
| 31 |
+
"Architecture": "T5-xl",
|
| 32 |
+
"Weight type": "fine-tuned",
|
| 33 |
+
"Num tokens": 294500,
|
| 34 |
+
"Num errors": 482,
|
| 35 |
+
"CER": 0.043,
|
| 36 |
+
"WER": 0.071,
|
| 37 |
+
"CER improvement": 0.034,
|
| 38 |
+
"WER improvement": 0.051,
|
| 39 |
+
"Hub License": "mit",
|
| 40 |
+
"#Params (B)": 3.0,
|
| 41 |
+
"Hub ❤️": 978,
|
| 42 |
+
"Available on the hub": True,
|
| 43 |
+
"Model sha": "d8a9e71"
|
| 44 |
+
},
|
| 45 |
+
# Add the other models similarly...
|
| 46 |
+
]
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def clean_model_name(model_markdown):
|
| 50 |
+
"""Extract a safe folder name from the markdown model string."""
|
| 51 |
+
match = re.match(r"\[(.*?)\]", model_markdown)
|
| 52 |
+
if match:
|
| 53 |
+
name = match.group(1)
|
| 54 |
+
# Replace unsafe characters for folder names
|
| 55 |
+
return re.sub(r'[<>:"/\\|?*]', '_', name)
|
| 56 |
+
return "unknown_model"
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
for model_info in models_data:
|
| 60 |
+
folder_name = clean_model_name(model_info["model"])
|
| 61 |
+
os.makedirs(folder_name, exist_ok=True)
|
| 62 |
+
|
| 63 |
+
# Save model_info to results.json in the folder
|
| 64 |
+
filepath = os.path.join(folder_name, "results.json")
|
| 65 |
+
|
| 66 |
+
with open(filepath, "w", encoding="utf-8") as f:
|
| 67 |
+
json.dump(model_info, f, indent=2, ensure_ascii=False)
|
| 68 |
+
|
| 69 |
+
print("Folders and results.json files created successfully.")
|