Welcome to the Translation Agent, an advanced linguistic conversion tool designed to seamlessly extract, translate, and consolidate content from PDF documents. This sophisticated utility leverages OpenAI's GPT model to provide accurate translations, generating a professional certificate of translation and merging the translated text with the original document into a comprehensive file.
- Robust Text Extraction: Efficiently pulls text from any PDF document.
- Intelligent Translation: Utilizes OpenAI's cutting-edge GPT model for high-quality translations.
- PDF Generation: Creates a PDF document of the translated text.
- Certificate of Translation: Automatically generates a verifiable certificate of translation.
- PDF Merging: Combines the original and translated PDFs into a single document for easy reference.
Ensure you have Python installed on your system. Then, install the necessary dependencies with the following command:
pip install -r requirements.txt
Execute the script from the command line, providing the necessary parameters:
python extract_and_translate.py --pdf_path "path/to/input.pdf" --output "path/to/output.pdf" --api_key "your-openai-api-key" --name "Your Name" --address "Your Address" --language_1 "Source Language" --language_2 "Target Language" --certificate_output "path/to/certificate.pdf"
python extract_and_translate.py --pdf_path 'sample.pdf' --output 'test.pdf' --api_key '<YOUR-API-KEY>' --name 'Markus Avrelius' --address '1111 Madeup st, MadeupTown, 94117, CA' --language_1 'Russian' --language_2 'English' --certificate_output 'test_certificate.pdf'
--pdf_path
: The path to the input PDF file.--output
: The desired path for the output merged PDF file.--api_key
: Your OpenAI API key for translation services.--name
: The name to be printed on the certificate of translation.--address
: The address to be included on the certificate of translation.--language_1
: The source language of the original document.--language_2
: The target language for the translation.--certificate_output
: The file path for the generated certificate of translation PDF.
We welcome contributions from the community! If you'd like to contribute to the Translation Agent, please follow these steps:
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix.
- Develop your changes in your branch.
- Ensure your code adheres to the existing style of the project to maintain consistency.
- Write or adapt tests as needed.
- Submit a pull request with a clear description of your changes.
For more details, please refer to the LICENSE file.
For support, feature requests, or contributions, please open an issue in the project's GitHub repository.