Lightweight cross-platform tool for correcting MinerU OCR texts
- 📄 Load and correct
_middle.jsonfiles generated by MinerU OCR - 🖼️ Side-by-side view of the original image and editable text
- 🔀 Toggle between original and span overlay views
- 🚩 Flag items for review
- 💬 Add comments to any bounding box
- 💾 Auto-save corrections back to the JSON file
- 🧰 Export
_middle.jsonto Markdown from UI, Dart CLI, or Windows app binary CLI mode - ⌨️ Extensive keyboard shortcuts for efficient workflow
- 🔍 Go to any item by number
- 📐 Adjustable UI scale for different screen sizes
You can download the latest release from the GitHub Releases page.
Dependencies:
- Flutter SDK 3.38.4
- Load a file — Open the app and select
File > Load JSON, then choose the_middle.jsonfile generated by MinerU OCR. - Edit text — The recognized text appears alongside the cropped image. Make corrections in the text field.
- Navigate — Use the arrow buttons or keyboard shortcuts to move between items.
- Flag & Comment — Mark items for review with the flag button or add comments via the comment button.
- Export Markdown — Use
File > Export Markdownto export the loaded_middle.jsoninto markdown. - Save — Click the save icon (or press
Ctrl+S) to write changes back to the JSON file. They are saved as 'corrected_content' fields in each line.
You can export a MinerU _middle.json file to markdown without launching the UI:
dart run bin/export_markdown.dart --input examples/straza/id-40086785_date-19091112_vol-01_no-132_middle.json --output build/cli_export_test.mdAfter building Windows, you can call the app binary directly in CLI mode:
veritium.exe --cli-export --input examples\straza\id-40086785_date-19091112_vol-01_no-132_middle.json --output build\windows_cli_export.md --no-images--cli-export is the explicit switch for binary CLI mode.
Options:
--input/-i(required): path to_middle.json--output/-o(optional): output markdown path--no-images(optional): skips markdown image entries from image blocks--original-content(optional): prefer original OCRcontentinstead ofcorrected_content--lists-as-text(optional): renders list blocks as plain text instead of markdown bullet lines--all-as-text(optional): renders titles, lists, and image paths as plain text (no markdown syntax)--block-separator(optional):double(default) uses a blank line between blocks,singleuses one newline--skip-flagged(optional): skips blocks whereis_flagged(orflagged) is set to true--skip-hashes(optional): path to text file with hashes to skip (one hash per line)--skip-hashes-mode(optional):span(default) removes matching spans only,lineremoves whole lines containing matching hashes--help/-h: show CLI help
By default, markdown export prefers corrected text (corrected_content) and falls back to original content when corrected text is missing.
By default, list blocks are exported as markdown bullet lines. Use --lists-as-text to export list blocks as plain text.
Use --all-as-text to force all supported block content into plain text output.
Use --block-separator single if you want a single newline between exported blocks.
If --output is omitted, output is created next to the input file using the same base name and .md extension.
You can export span hashes where corrected_content field is present and empty:
dart run bin/export_empty_corrected_hashes.dart --input examples/straza/id-40086785_date-19091112_vol-01_no-132_middle.json --output build/empty_corrected_hashes.txtAfter building Windows, you can call the app binary directly in hash export CLI mode:
veritium.exe --cli-export-empty-hashes --input examples\straza\id-40086785_date-19091112_vol-01_no-132_middle.json --output build\empty_corrected_hashes.txt--cli-export-empty-hashes is the explicit switch for binary hash export mode.
Options:
--input/-i(required): path to_middle.json--output/-o(optional): output text file path--help/-h: show CLI help
Notes:
- Only spans with a non-empty
hashare included. - A hash is exported only if
corrected_contentfield is present and empty after trimming. - Duplicate hashes are preserved in output order.
flutter testcovers CLI behavior (test/cli_export_test.dart) and markdown export logic.- GitHub Actions runs:
- Dart CLI smoke test in Linux CI
- Windows binary CLI smoke test in the Windows release build job
| Shortcut | Action |
|---|---|
F7 / Alt + ← |
Previous item |
F8 / Alt + → |
Next item |
Ctrl + S |
Save corrected JSON |
Ctrl + F |
Toggle flag on current item |
Ctrl + T |
Add comment |
Ctrl + G |
Go to item |
Ctrl + = / Ctrl + + |
Increase UI scale |
Ctrl + - |
Decrease UI scale |
💡 Press
File > Show Keyboard Shortcutsin the app for a full list.
See CHANGELOG.md for release history and details.
Internal source map and major function reference: docs/README.md
Contributions, issues, and feature requests are welcome!
In case you have issues after updating Visual Studio to the latest version, do the following:
rm -rf ./build
flutter clean
flutter pub get
Afterwards, it should work again without any issues. As normally, to start the app, run flutter run in the root directory.
This project is licensed under the MIT License.
