PDF 논문 번역 및 비교 분석 라이브러리 BabelDOC 활용 가이드
요약
BabelDOC은 과학 논문 PDF를 전문적으로 번역하고 양방향 비교 분석을 지원하는 강력한 오픈소스 라이브러리입니다. 온라인 서비스(Immersive Translate)와 자체 배포 환경 모두를 제공하여 사용 편의성을 높였습니다. 개발자들은 Python API나 CLI를 통해 이 기능을 다른 프로그램에 임베드하거나, 직접 PDF 파일을 처리할 수 있습니다. 특히 `uv run` 방식을 권장하며, OpenAI 등의 LLM을 활용해 높은 품질의 번역 결과를 얻을 수 있습니다.
핵심 포인트
- BabelDOC은 과학 논문(PDF) 전문 번역 및 양방향 비교 분석 기능을 제공하는 라이브러리입니다.
- 사용자는 온라인 서비스(Immersive Translate, 월 1000 페이지 무료) 또는 자체 배포 환경을 선택할 수 있습니다.
- CLI 사용 시 `uv run` 방식을 권장하며, `--files` 옵션과 함께 OpenAI API 키를 지정하여 번역을 실행합니다.
- 주요 기능은 PDF 파일의 다국어 번역 및 원문-번역본 비교 분석이며, Python API를 통해 임베딩이 가능합니다.
PDF scientific paper translation and bilingual comparison library.
- Online Service: Beta version launched Immersive Translate - BabelDOC Free usage quota is available; please refer to the FAQ section on the page for details.
- Self-deployment: PDFMathTranslate-next support for BabelDOC, available for self-deployment + WebUI with more translation services.
- Provides a simple command line interface.
- Provides a Python API.
Mainly designed to be embedded into other programs, but can also be used directly for simple translation tasks.
Tip: How to use BabelDOC in Zotero
- Immersive Translate Pro members can use the immersive-translate/zotero-immersivetranslate plugin
- PDFMathTranslate self-deployed users can use the guaguastandup/zotero-pdf2zh plugin
Using BabelDOC via Command Line (CLI)
Method 1: Using uv tool install
We recommend using the Tool feature of uv to install yadt.
- First, you need to refer to uv installation to install uv and set up the PATH environment variable as prompted.
- Use the following command to install yadt:
uv tool install --python 3.12 BabelDOC
babeldoc --help```
3. Use the `babeldoc` command. For example:
```bash
babeldoc --openai --openai-model "gpt-4o-mini" --openai-base-url "https://api.openai.com/v1" --openai-api-key "your-api-key-here" --files example.pdf
# multiple files
babeldoc --openai --openai-model "gpt-4o-mini" --openai-base-url "https://api.openai.com/v1" --openai-api-key "your-api-key-here" --files example1.pdf --files example2.pdf
Method 2: Using uv run (Recommended)
We still recommend using uv to manage virtual environments.
- First, you need to refer to uv installation to install uv and set up the PATH environment variable as prompted.
- Use the following command to install yadt:
# clone the project
git clone https://github.com/funstory-ai/BabelDOC
# enter the project directory
cd BabelDOC
# install dependencies and run babeldoc
uv run babeldoc --help
- Use the
uv run babeldoccommand. For example:
uv run babeldoc --files example.pdf --openai --openai-model "gpt-4o-mini" --openai-base-url "https://api.openai.com/v1" --openai-api-key "your-api-key-here"
# multiple files
uv run babeldoc --files example.pdf --files example2.pdf --openai --openai-model "gpt-4o-mini" --openai-base-url "https://api.openai.com/v1" --openai-api-key "your-api-key-here"
CLI Options Reference
Tip: The absolute path is recommended.
Note: This CLI is mainly for debugging purposes. Although end users can use this CLI to translate files, we do not provide any technical support for this purpose.
- End users should directly use Online Service: Beta version launched Immersive Translate - BabelDOC 1000 free pages per month.
- End users who need self-deployment should use PDFMathTranslate 2.0
- If you find that an option is not listed below, it means that this option is a debugging option for maintainers. Please do not use these options.
| Option | Short | Description | Default |
|---|---|---|---|
--lang-in | -li | Source language code | en |
--lang-out | -lo | Target language code | zh |
Tip: Currently, this project mainly focuses on English-to-Chinese translation, and other scenarios have not been tested yet.
(2025.3.1 update): Basic English target language support has been added, primarily to minimize line breaks within words([0-9A-Za-z]+).
| Option | Description |
|---|---|
--files | One or more file paths to input PDF documents. |
--pages | -p: Specify pages to translate (e.g., |
AI 자동 생성 콘텐츠
본 콘텐츠는 GitHub Trending Python (daily)의 원문을 AI가 자동으로 요약·번역·분석한 것입니다. 원 저작권은 원저작자에게 있으며, 정확한 내용은 반드시 원문을 확인해 주세요.
원문 바로가기