fix: Revise README for accuracy, usability, and dependency compatibility

#2
by vawsgit - opened
Amazon org

At a Glance

  • Source: Usability audit of amazon/doc_split HuggingFace dataset README
  • Items: 10 targeted repairs + 1 dependency fix
  • Categories: Documentation accuracy, Quick Start, schema docs, CLI defaults, project structure, dependency compatibility

High-Impact Changes

# Change Files Why It Matters
1 πŸš€ Add load_dataset() Quick Start at top of README README.md Users can load the dataset in 3 lines without reading the entire toolkit README
2 πŸ”§ Fix 6 incorrect CLI default values README.md --num-docs-train was documented as 8 (actual: 800), --num-docs-test as 5 (actual: 500), --num-docs-val as 2 (actual: 200) β€” users copying examples would get wrong results
3 πŸ“¦ Loosen tokenizers==0.20.3 pin to >=0.20.3 requirements.txt Exact pin conflicts with transformers>=4.48.0 which requires tokenizers>=0.21 β€” pip install fails
4 ⚠️ Add Python 3.12 recommendation for textractor commands README.md amazon-textract-textractor C extensions (editdistance) fail to build on Python 3.13+

All Changes by Category

πŸš€ Quick Start & Usability

  • Add load_dataset() Quick Start section: New section at top of README with working code examples for loading splits, accessing fields, and iterating subdocuments. README.md
  • Add Dataset Schema section: Documents all 13 fields across 3 nesting levels (doc, subdocument, page) in table format. README.md

πŸ”§ CLI Defaults & Parameters

  • Fix --num-docs-train default: 8 β†’ 800. README.md
  • Fix --num-docs-test default: 5 β†’ 500. README.md
  • Fix --num-docs-val default: 2 β†’ 200. README.md
  • Add note about asset script path defaults: Code defaults (../raw_data, ../processed_assets) assume running from src/assets/; README examples use repo-root paths. README.md
  • Consolidate duplicate benchmark sections: Removed brief duplicate, kept detailed version with corrected values. README.md

πŸ“„ Data Format Documentation

  • Replace fictional output format with actual formats: Removed fabricated JSON example, added real Ground Truth JSON schema and CSV column reference. README.md
  • Document dual asset path prefixes: JSON uses rvl-cdip-nmp-assets/, CSV uses data/assets/ β€” now explained. README.md
  • Add asset path resolution note: Clarifies that image_path/text_path reference assets not included in the dataset download. README.md

πŸ—οΈ Project Structure

  • Fix project structure tree: strategies/ β†’ shuffle_strategies/, added asset_creator.py, deepseek_ocr.py, base_strategy.py, __init__.py, models.py files. Removed non-existent split_mapping.json. README.md

πŸ“Š Dataset Statistics

  • Qualify document counts to specific strategy: Counts (417/96/51) are for mono_rand/large only β€” other strategy/size combos vary significantly. README.md

πŸ“¦ Dependency Compatibility

  • Loosen tokenizers pin: tokenizers==0.20.3 β†’ tokenizers>=0.20.3. Resolves install failure with modern transformers. requirements.txt
  • Add Python 3.12 recommendation: textractor C extensions fail on 3.13+; added admonitions to Requirements section and asset creation commands. README.md
  • Add requirements.txt note: Documents that GPU deps (PyTorch, Transformers) are only needed for DeepSeek OCR. README.md

πŸ§ͺ Verification

All changes were verified with 18 automated tests across two phases:

Phase Scope Results
Phase 4: API Verification Schema fields, CLI defaults, project structure, cross-references βœ… 9 PASS, 0 FAIL, 1 WARN
Phase 5: CLI Commands load_dataset, snapshot_download, run.py --help, Quick Start code, LFS clone βœ… 8 PASS, 0 FAIL, 0 WARN

Total: 17 PASS, 0 FAIL, 1 WARN β€” the WARN (V-08) confirms document counts vary by strategy, validating the qualification added in this PR.

Key commands tested end-to-end:

  • load_dataset("amazon/doc_split") β€” all 3 splits βœ…
  • load_dataset("amazon/doc_split", split="test") β€” correct keys βœ…
  • Full Quick Start code block β€” runs without error βœ…
  • python src/benchmarks/run.py --help β€” all documented flags present βœ…
  • python src/benchmarks/run.py --strategy poly_seq ... β€” imports resolve, fails gracefully on missing assets βœ…
  • python src/assets/run.py --help β€” works with Python 3.12 + uv βœ…
  • GIT_LFS_SKIP_SMUDGE=1 git clone β€” .py files are real source βœ…

Patterns & Observations

  • πŸ” Defaults were copy-paste errors: The 3 --num-docs-* defaults were off by 100x (8/5/2 vs 800/500/200), suggesting they were placeholder values that were never updated after the argparse code was finalized.
  • πŸ“‹ Fictional example syndrome: The original "Benchmark Output Format" JSON was entirely fabricated β€” it didn't match any actual file in the repo. The replacement uses verified schema from real dataset files.
  • 🐍 Python 3.13 compatibility gap: amazon-textract-textractor β†’ editdistance C extension build fails on 3.13. This is an upstream issue but affects anyone following the README's install instructions on a modern Python.
  • πŸ“Œ Overly strict pin: tokenizers==0.20.3 was incompatible with the repo's own transformers>=4.48.0 constraint β€” pip install -r requirements.txt was broken out of the box.
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment