Skip to content

This tool translates Word documents (.docx, .doc) while preserving formatting, images, and user-specified terms. It supports multiple target languages and aims to maintain the original document structure after translation.

Notifications You must be signed in to change notification settings

Prasaderp/Word-Document-Translation-with-Structure-Preserved-OpenAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Document Translator - Setup (Windows)

Prerequisites

  • Python 3.10+ installed
  • An OpenAI API key

Install

  1. Open PowerShell and go to the project folder:
cd TextTranslation
  1. Create and activate a virtual environment:
python -m venv venv
./venv/Scripts/activate
  1. Upgrade pip and install dependencies:
python -m pip install --upgrade pip
pip install -r requirements.txt
  1. Download the spaCy model (recommended):
python -m spacy download en_core_web_sm
  1. Create a .env file in the project folder with your API key:
OPENAI_API_KEY=your_openai_api_key_here

Run

uvicorn fastapi_app:app --host 0.0.0.0 --port 8000 --reload

After it starts, open the URL shown in the terminal. The default url is: 0.0.0.0:8000

About

This tool translates Word documents (.docx, .doc) while preserving formatting, images, and user-specified terms. It supports multiple target languages and aims to maintain the original document structure after translation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published