No description
  • Python 84.9%
  • HTML 13.7%
  • Shell 1.4%
Find a file
RMS 07ddcfa548 docs: update AGENTS.md with foxaholic parser details
Add CDP, cookies, and one-command mise usage instructions.
Update supported sites and architecture sections.
2026-07-28 18:16:41 -06:00
output fix: replace ###PARA### delimiter in fallback to prevent leaking into output files 2026-05-15 13:49:51 -06:00
parsers feat: add foxaholic.com parser with CDP browser hijack 2026-07-28 18:16:35 -06:00
scripts feat: add epub-foxaholic one-command mise task 2026-07-28 18:16:38 -06:00
.gitignore chore: add playwright, remove unused experiment deps 2026-07-28 18:16:31 -06:00
.pre-commit-config.yaml chore: set up project tooling with uv, pre-commit, and black 2026-05-11 16:32:24 -06:00
.python-version chore: set up project tooling with uv, pre-commit, and black 2026-05-11 16:32:24 -06:00
AGENTS.md docs: update AGENTS.md with foxaholic parser details 2026-07-28 18:16:41 -06:00
comparison-tool-plan.md fix: merge exploded paragraphs in normalization for closer raw alignment 2026-05-13 16:50:27 -06:00
extract_comparison.py fix: merge exploded paragraphs in normalization for closer raw alignment 2026-05-13 16:50:27 -06:00
frontend-comparison-spec.md fix: merge exploded paragraphs in normalization for closer raw alignment 2026-05-13 16:50:27 -06:00
migrate_sections.py feat: multi-model support with per-model config and section-based output 2026-05-11 19:11:19 -06:00
mise.toml feat: add epub-foxaholic one-command mise task 2026-07-28 18:16:38 -06:00
normalize_translations.py fix: merge exploded paragraphs in normalization for closer raw alignment 2026-05-13 16:50:27 -06:00
pyproject.toml chore: add playwright, remove unused experiment deps 2026-07-28 18:16:31 -06:00
README.md docs: align README table formatting 2026-05-15 14:45:54 -06:00
scrape_to_epub.py feat: add foxaholic.com parser with CDP browser hijack 2026-07-28 18:16:35 -06:00
sugoi-translator.html feat: add initial implementation of Sugoi Chapter Translator UI 2026-05-11 16:48:54 -06:00
translate_novel.py fix: increase context window and batch size for qwen models, correct sugoi prompt typo 2026-05-15 14:44:40 -06:00
uv.lock chore: add playwright, remove unused experiment deps 2026-07-28 18:16:31 -06:00

Syosetu → Astro Translator

Scrapes chapters from a syosetu.com novel, translates via LM Studio, and writes Astro-compatible markdown files.

Setup

uv sync

Point LM_STUDIO_URL in translate_novel.py to your LM Studio server address.

Usage

Translate with model selection

uv run python translate_novel.py

Without arguments, the script prompts you to select model(s) interactively.

Specify model(s) by CLI argument (config key or model ID):

uv run python translate_novel.py unsloth/qwen3.5-9b@q8_0
uv run python translate_novel.py google/gemma-4-26b-a4b unsloth/qwen3.5-9b@q8_0

Flags

Flag Description
--section N Translate only section N (114)
--chapter N Translate only chapter N. If --section is also set, N is the chapter-within-section number; otherwise N is the absolute chapter number
--force Re-translate existing chapters (skips mtime check)

Examples:

# Section 14 only
uv run python translate_novel.py unsloth/qwen3.5-9b@q8_0 --section 14

# Single chapter, force retranslate
uv run python translate_novel.py unsloth/qwen3.5-9b@q8_0 --section 14 --chapter 4 --force

Post-processing

# Normalize spacing for cross-model comparison
python normalize_translations.py [--dry-run] [--verbose] [--normalize-quotes]

# Extract paragraph-aligned comparison data
python extract_comparison.py [--align {direct,merged,both}]

Migration

python migrate_sections.py

Output structure

output/n5290ea/
├── raw/                        # Scraped Japanese source
├── translated/{model}/         # Translation output by model
└── normalized/{model}/         # Spacing-normalized copies for comparison

Model configuration

Models are configured in MODEL_CONFIGS in translate_novel.py. Each entry defines temperature, sampling parameters, chunk size, and the system/user prompts sent to the LM Studio API. Model metadata (GPU layers, context window) is stored in MODEL_METADATA.

Config keys are matched to LM Studio model IDs via the model_id field. If a config key contains /, it's used as-is in output folder names (e.g., unsloth/qwen3.5-9b@q8_0unsloth-qwen3.5-9b@q8_0).

Components

Script Purpose
translate_novel.py Main pipeline: scrape + translate + write
normalize_translations.py Post-process translated files for comparison
extract_comparison.py Build paragraph-aligned comparison data across models
migrate_sections.py Migrate files to section-based naming