Logo: Mineru Pdf Translate

Mineru Pdf Translate

Communautéit
flycalm
mineru-pdf-translate

Translate local PDF papers through MinerU and an OpenAI-compatible model into final PDFs. Correct OCR using source PDF crops during translation, preserve figures, and validate formula and image rendering.

Iwwersiicht

Editeurflycalm
Repositorymineru-pdf-translate
Skill-Nummmineru-pdf-translate
Stären
99
Forks
3
Matgeliwwert Dateien
4
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 4 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    flycalm huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Mineru Pdf Translate an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/flycalm/mineru-pdf-translate/tree/main/mineru-pdf-translate
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/flycalm/mineru-pdf-translate.git /tmp/mineru-pdf-translate
mkdir -p .claude/skills
cp -r /tmp/mineru-pdf-translate/mineru-pdf-translate .claude/skills/mineru-pdf-translate
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Mineru Pdf Translate an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Mineru Pdf Translate automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Mineru Pdf Translate net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

MinerU PDF Translate

Run scripts/pdf_translate.py on the folder containing the source PDFs. Translate the entire document, including appendices and captions. Deliver the final PDFs in translated/; keep intermediate files out of that folder. Do not produce a separate inspection report unless requested.

Translation and correction

The default --ocr-correction auto supplies the translation model with original PDF crops and MinerU's OCR strings for formulas and tables. Corrections are returned separately from the translated prose, so the model cannot accidentally remove or reorder protected units.

  • Correct transcription errors against the source, including empty-set symbols, norm bars, signs, accents, indices, equation numbering and table cell alignment. Preserve the author's mathematics, data and claims.
  • Correct obvious OCR errors in prose using context. A word mistakenly detected as inline math can return to ordinary translated text.
  • Use source images for units the model cannot read confidently, for invalid corrections, and for models that reject image input. Translate surrounding prose and captions normally. Internal labels in source images remain in the original language.
  • Preserve formula numbering. A MathJax syntax error in a corrected formula triggers a source-image fallback during rendering.
  • Source comparison needs MinerU layout.json and Python PyMuPDF. If unavailable, explain the limitation; use --ocr-correction off only when the user accepts translation without automatic source comparison.
  • Custom ocr_repairs.json remains available for exact, source-verified prose repairs. Do not add paper-specific symbols, file names or inferred formulas to the built-in rules.

The correction process is conservative but cannot guarantee semantic correctness. Inspect representative complex equations, tables and the appendix ending against the original before delivery. Internal validation runs without creating a separate report.

Configuration

Read configuration privately; never display credentials or signed storage URLs. Prefer explicit command options, then files in the PDF folder, then environment variables.

Supported files:

  • mineru密钥.txt: MinerU token.
  • 翻译大模型url以及key.txt: base URL and API key on two lines.
  • 大模型和mineru的key.txt: labelled model:, url:, key: and mineru: fields. A value may occupy the next line. Do not duplicate these keys into the skill folder.

Environment alternatives: MINERU_API_TOKEN, PDF_TRANSLATE_LLM_BASE_URL, PDF_TRANSLATE_LLM_API_KEY, PDF_TRANSLATE_MODEL. Choose a model accepting image input for automatic OCR correction. The script uses the model supplied in configuration; the legacy default applies only when no model is specified.

The renderer needs Node.js, Playwright and an installed Edge/Chrome/Chromium browser. It discovers the Codex bundled Node/Playwright runtime when available. Outside Codex, use an installed Node playwright package or set PDF_TRANSLATE_NODE_MODULES to its node_modules folder. Override the executables with PDF_TRANSLATE_NODE, PDF_TRANSLATE_BROWSER or --browser-path. The Python markdown package is installed automatically if missing; PyMuPDF is needed for source crops.

Commands

Resolve <skill-dir> to this skill's directory. On Windows, use py if python resolves to a nonworking Store alias.

Translate and retain caches for inspection or rerendering:

powershell
python <skill-dir>\scripts\pdf_translate.py --workdir <pdf-folder> --keep-temp

Re-render cached translations without MinerU or model calls:

powershell
python <skill-dir>\scripts\pdf_translate.py --workdir <pdf-folder> --render-only --keep-temp

Other options:

  • --workers 3: maximum simultaneous translation requests. Lower this for a rate-limited endpoint.
  • --target-language "Japanese" --target-suffix ja: choose another target.
  • --force: discard document caches and rebuild. Do not use this merely to retry interrupted chunks or fix rendering.
  • --ocr-correction off: protect extracted formulas without source comparison; use only for an explicitly accepted legacy workflow.

Reliability and rendering

  • Failed or interrupted runs retain their caches. MinerU task IDs survive upload, polling and download failures; resume an existing task rather than paying for another parse. Successful translation chunks are written atomically and reused only for matching source, model, endpoint, language and correction mode.
  • Preserve source whitespace at chunk boundaries. Never concatenate stripped chunks in a way that joins headings to paragraphs or words together. Limit image evidence per request without changing source order.
  • Embed local images into the render HTML and use short temporary rendering paths to avoid Windows path-loading failures. Group multi-panel figures only when the layout identifies one figure and the image references are contiguous; do not swallow captions or intervening text.
  • Wait for fonts, images and MathJax startup to finish. Missing images, remaining placeholder tokens and unresolved formula errors fail rendering. Print without browser headers or footers. Replace a previous output only after a valid new PDF exists.
  • Disable MathJax's noundefined extension so unknown commands raise detectable errors rather than printing macro names (see MathJax v3 documentation).
  • MathJax v3 is loaded from the existing CDN; if unavailable, report the render failure and retain caches. Do not treat file existence alone as proof that equations rendered.
  • MinerU uploads directly to its own storage by default. Connection errors use bounded retries and can try its OSS acceleration hostname. PDF_TRANSLATE_UPLOAD_HOST overrides the alternate hostname. Optional PDF_TRANSLATE_DOWNLOAD_RESOLVE=host:443:ip uses curl's route override with normal TLS verification; do not change system DNS or disable certificate verification.
  • --keep-temp retains MinerU output, source crops and per-chunk translation caches in .pdf_translate_tmp/. No QA report is written. Failed-file diagnostics stay in the temporary folder.

If the user also requests Zotero import, use an available Zotero tool, deduplicate by reliable metadata, attach the original and final translation to the same parent item, and verify the stored attachments. PDF translation alone does not request a Zotero mutation.

Resources

  • scripts/pdf_translate.py: batch parsing, translation, resumable caching and rendering.
  • scripts/source_evidence.py: source-coordinate crops, formula/table pairing and correction validation.
  • scripts/render_pdf.cjs: browser completion waits and source fallback for invalid math.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Mineru Pdf Translate?

Translate local PDF papers through MinerU and an OpenAI-compatible model into final PDFs. Correct OCR using source PDF crops during translation, preserve figures, and validate formula and image rendering.

Firwat Mineru Pdf Translate op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Mineru Pdf Translate besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Mineru Pdf Translate an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/flycalm/mineru-pdf-translate/tree/main/mineru-pdf-translate an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Mineru Pdf Translate benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Mineru Pdf Translate benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Mineru Pdf Translate domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Mineru Pdf Translate gratis?

Jo. flycalm huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇