AI Personal Learning
and practical guidance

Doc2XAPITranslate: full-text translation of documents: quickly translate English PDF/MD papers into Chinese documents.

General Introduction

Doc2XAPITranslate is a powerful full-text document translation tool designed for quickly translating English PDF or Markdown papers into Chinese documents. The tool supports multiple translators, including DeepSeek, OpenAI, Ollama, Google Translate, DeepL and DeeLX, to ensure the accuracy and diversity of translations.Doc2XAPITranslate is able to preserve formulas, tables and images formatting in the original text, providing high quality translation results. Users can convert documents to Markdown or Word format with simple operations for subsequent editing and use.

Doc2XAPITranslate: full-text translation of documents: fast translation of English PDF/MD papers into Chinese documents-1


 

Function List

  • Multi-translator support: A variety of built-in translators such as DeepSeek, OpenAI, Ollama, Google Translate, DeepL and DeeLX.
  • multithreaded translation: Support multi-threaded translation to improve translation speed and efficiency.
  • Format retention: Preserve formulas, tables and graphic formats in the original text to ensure the integrity of the translation result.
  • Multiple output formats: Supports output of translation results to Markdown or Word format.
  • Customized Translator: Users can customize the translator to meet specific needs.
  • GUI interface: Provides a friendly graphical user interface for user-friendly operation.
  • CLI support: Supports command line interface operation for advanced users and automated processes.

 

Using Help

Installation process

  1. Windows (computer)::
    • Download and install Pandoc.
    • Install by entering the following command in Powershell: shell
      winget install --source winget --exact --id JohnMacFarlane.Pandoc
  2. MacOS::
    • Run the following command in a terminal to install Pandoc: shell
      brew install pandoc
  3. Ubuntu/Debian::
    • Run the following command in a terminal to install Pandoc: shell
      sudo apt install pandoc
  4. Arch/Manjaro::
    • Run the following command in a terminal to install Pandoc: shell
      sudo pacman -S pandoc-cli

Usage Process

  1. Run the GUI program::
    • Download the precompiled program, unzip it and run it.
    • Import the Markdown or PDF file, select the translator and translation settings, and click Start Translation.
    • When the translation is complete, select the output format (Markdown or Word) and save the file.
  2. Running a CLI program::
    • Clone the current repository: shell
      git clone https://github.com/NoEdgeAI/Doc2XAPITranslate.git
      cd Doc2XAPITranslate
    • Create and activate a virtual environment: shell
      conda create -n translate python=3.12
      conda activate translate
    • Install the dependencies: shell
      pip install -r requirements.txt
    • Run the program: shell
      python Main.py

Customized Translator

  1. Define the translation function::
   def translate(text: str, prev_text: str, next_text: str) -> str.
try.
return "This is an example!"
except Exception as e: print(f "Error: {e}")
print(f "Error: {e}")
return text
  1. Using a Custom Translator::
   from MD_Translate import Process_MD
file_path = "path/to/your/md/file.md"
threads = 10
Process_MD(md_file=file_path, translate=translate, thread=threads)
May not be reproduced without permission:Chief AI Sharing Circle " Doc2XAPITranslate: full-text translation of documents: quickly translate English PDF/MD papers into Chinese documents.

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish