Skip to content

Update PDF batch-processing guidance and topic-modelling walkthrough - #3887

Open
maehr wants to merge 2 commits into
programminghistorian:gh-pagesfrom
maehr:update-pdf-batch-processing-lesson
Open

maehr wants to merge 2 commits into
programminghistorian:gh-pagesfrom
maehr:update-pdf-batch-processing-lesson

Conversation

@maehr

@maehr maehr commented Oct 21, 2026

Copy link
Copy Markdown

Related to #3860.

The lesson still contains outdated installation instructions, batch commands that reuse source filenames, and a DARIAH Topics Explorer walkthrough. This draft updates those instructions while preserving the PDF → OCR → text extraction → corpus analysis workflow.

Changes

  • Refresh the Windows/WSL, macOS/Homebrew and Linux installation guidance, and distinguish required English language data from optional language packs and image-cleaning tools.
  • Write OCR, text and image outputs to separate folders with predictable filenames. Explain --skip-text, --redo-ocr and --force-ocr, including the incompatibility between redoing OCR and deskewing, and make --clean optional.
  • Restrict searches to extracted text and document ImageMagick 7's magick command, the ImageMagick 6 fallback and the img2pdf workaround.
  • Replace the compact ILO download pipeline with a readable loop that reports the expected file count, retries failures and renames temporary files only after successful downloads. Clarify how to use the prepared Zenodo texts.
  • Replace the DARIAH walkthrough with Simple Topic Modeling, explaining NMF with TF-IDF, optional LDA, stop words, random seeds, diagnostics, representative documents and exports.
  • Replace Figure 2 with a fresh 1255 × 1635 screenshot of the lesson corpus, update its interpretation and add the exported config.json so readers can repeat the example.

Validation

  • Verified the Zenodo archive checksum and its 340 text files; confirmed the current ILO directory listing produces 340 English PDF filenames.
  • Ran the local Simple Topic Modeling v2 app with all 340 lesson texts, English stop words, NMF, 30 topics, 5,000 terms and seed 42. Verified the exported configuration loads through the app.
  • Checked all 20 Bash examples for syntax, exercised failed-download/retry behaviour and preservation of existing files, and checked image references and git diff --check.
  • Full Jekyll build remains unverified locally because the required Bundler 2.4.22 is unavailable.

Before this draft is ready

claude and others added 2 commits October 21, 2026 11:44
…Explorer

Addresses programminghistorian#3860 with targeted guidance updates
that keep the lesson's approach:

- Add an update notice that lists the changes and the tool versions used
  to check the commands.
- Replace the Windows 10 / Ubuntu 18.04 WSL steps with `wsl --install`,
  the obsolete Homebrew installer with the current one, and the Ubuntu
  18.04 instructions with current Ubuntu LTS. Install only the English
  Tesseract data and explain how to add other languages.
- Never overwrite source PDFs: OCRmyPDF, pdftotext and pdfimages now
  write to separate `ocr/`, `text/` and `images/` folders with
  predictable file names.
- Use `--skip-text` for batch OCR, since OCRmyPDF aborts on pages that
  already contain text by default. Drop `--clean` from the default
  commands, explain that it needs unpaper, and mention `--redo-ocr` and
  `--force-ocr` for bad text layers.
- Restrict the grep examples to the `text/` folder.
- Use ImageMagick 7's `magick` command and explain the `convert`
  fallback and the img2pdf workaround for the PDF security policy.
- Replace the ILO download one-liner with a readable loop that reports
  the file count, fails loudly, can resume, and points to Zenodo.
- Replace DARIAH Topics Explorer with Simple Topic Modeling
  (https://maehr.github.io/simple-topic-modeling/): NMF with TF-IDF as
  the default, LDA as an option, stop words, random seed, diagnostics,
  and repeatable runs through config.json. Remove the DARIAH screenshot.
- Update the WSL, grep and topic-model references.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018k44PqSnqQ4gfSwQHwq2E9
@anisa-hawes anisa-hawes self-assigned this Oct 21, 2026
@maehr
maehr marked this pull request as ready for review October 22, 2026 06:44
Copilot AI balanced review requested due to automatic review settings October 22, 2026 06:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@maehr

maehr commented Oct 22, 2026

Copy link
Copy Markdown
Author

@anisa-hawes, thanks for reviewing this PR. As you can see, I used Claude (Opus 5.5/High) for assistance. I hope this is okay with you and with the Programming Historian's AI rules.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants