PDFMathTranslate
PDF scientific paper translation and bilingual comparison based on font rules and deep learning, preserving formula and figure layout.
Installation
pip install pdf2zh
Usage
Execute the translation command in the command line to generate the translated document example-zh.pdf and the bilingual document example-dual.pdf in the current directory.
Translate the entire document
pdf2zh example.pdf
Translate part of the document
pdf2zh example.pdf -p 1-3,5
Translate with the specified language
pdf2zh example.pdf -li en -lo ja
Use regex to specify formula fonts and characters that need to be preserved
Hint: Starting from \ufb00 is English style ligature.
pdf2zh BDA3.pdf -f "(CM[^RT].*|MS.*|XY.*|MT.*|BL.*|.*0700|.*0500|.*Italic)" -c "(\(|\||\)|\+|=|\d|[\u0080-\ufaff])"
Acknowledgement
Document merging: PyMuPDF
Document parsing: Pdfminer.six
Document extraction: MinerU
Multi-threaded translation: MathTranslate
Layout parsing: DocLayout-YOLO
Star History
Release files for pdf2zh 1.5.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdf2zh-1.5.9.tar.gz | 142.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdf2zh-1.5.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 292.3 kB
Release files / pdf2zh-1.5.9.tar.gz
| Download URL | pdf2zh-1.5.9.tar.gz |
|---|---|
| Size | 142.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
039e8f7e8fb8c8e441667d3a01d6e5be25619fb309110c446f822ecd52907d4f
|
|
BLAKE2b-256 checksum How to use checksums |
296dac5c0cf959d0f1c23978fa084eefe8694a52dc7130d9213de94a6cf8f0c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|
Release files / pdf2zh-1.5.9-py3-none-any.whl
| Download URL | pdf2zh-1.5.9-py3-none-any.whl |
|---|---|
| Size | 150.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dffc2ffae4fc8b593e86add3fdc5a50f6fc677a371f89296d6bb223ed505fd2
|
|
BLAKE2b-256 checksum How to use checksums |
f6943cacf1b4b9b70b2d818acea2be3f807fb1640d34317c94fd65a298fae3a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|