{"id":31546450,"url":"https://github.com/md-emon-hasan/translatica","last_synced_at":"2026-04-13T12:01:47.890Z","repository":{"id":316262024,"uuid":"974916907","full_name":"Md-Emon-Hasan/Translatica","owner":"Md-Emon-Hasan","description":"Spanish literary translation system, fine-tuned using PEFT with LoRA for high accuracy and minimal compute cost. Built with an intuitive, premium-grade web interface with FastAPI, Bootstrap andcustom animations","archived":false,"fork":false,"pushed_at":"2026-02-23T06:26:49.000Z","size":11921,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-23T14:36:02.171Z","etag":null,"topics":["ai-app","artificial-intelligence","bilingual-translation","data-science","datascience","dockerized-app","english-to-spanish","fine-tuning","fine-tuning-llm","github-actions","huggingface","language-model","language-modeling","machine-learning","multilingual-nlp","nlp-pipeline","nlp-projects","opus-mt","pytorch","tokenizer"],"latest_commit_sha":null,"homepage":"https://bilingual-bridge.onrender.com","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Md-Emon-Hasan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-29T13:55:11.000Z","updated_at":"2026-02-23T06:26:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"5eb8cdbd-0d0e-475d-9409-5076d54a8e85","html_url":"https://github.com/Md-Emon-Hasan/Translatica","commit_stats":null,"previous_names":["md-emon-hasan/translatica"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Md-Emon-Hasan/Translatica","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Md-Emon-Hasan%2FTranslatica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Md-Emon-Hasan%2FTranslatica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Md-Emon-Hasan%2FTranslatica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Md-Emon-Hasan%2FTranslatica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Md-Emon-Hasan","download_url":"https://codeload.github.com/Md-Emon-Hasan/Translatica/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Md-Emon-Hasan%2FTranslatica/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31751705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-app","artificial-intelligence","bilingual-translation","data-science","datascience","dockerized-app","english-to-spanish","fine-tuning","fine-tuning-llm","github-actions","huggingface","language-model","language-modeling","machine-learning","multilingual-nlp","nlp-pipeline","nlp-projects","opus-mt","pytorch","tokenizer"],"created_at":"2025-10-04T15:12:59.020Z","updated_at":"2026-04-13T12:01:47.885Z","avatar_url":"https://github.com/Md-Emon-Hasan.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Translatica: English to Spanish Translation\n\n[![CI/CD](https://github.com/Md-Emon-Hasan/Translatica/actions/workflows/main.yml/badge.svg)](https://github.com/Md-Emon-Hasan/Translatica/actions) [![Python](https://img.shields.io/badge/python-3.11-blue)](https://python.org) ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=flat\u0026logo=typescript\u0026logoColor=white) [![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=flat\u0026logo=fastapi)](https://fastapi.tiangolo.com) ![React](https://img.shields.io/badge/react-%2320232a.svg?style=flat\u0026logo=react\u0026logoColor=%2361DAFB) ![Vite](https://img.shields.io/badge/vite-%23646CFF.svg?style=flat\u0026logo=vite\u0026logoColor=white) ![TailwindCSS](https://img.shields.io/badge/tailwindcss-%2338B2AC.svg?style=flat\u0026logo=tailwind-css\u0026logoColor=white) ![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=flat\u0026logo=PyTorch\u0026logoColor=white) ![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97-Hugging%20Face-yellow) ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=flat\u0026logo=docker\u0026logoColor=white) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**Translatica** is a production-ready AI-powered **English → Spanish literary translation system** designed to preserve tone, context, and narrative style. It leverages a **LoRA-fine-tuned transformer (PEFT)** to deliver high-quality translations with low inference cost, supported by a modular NLP pipeline, BLEU-based evaluation, and a clean full-stack web interface.\n\nThe system is **Dockerized and deployment-ready**, and can be scaled as a **SaaS product** for publishers and content platforms—demonstrating strong expertise in **model optimization, end-to-end system design, and business-oriented AI engineering**.\n\n[![Project demo video](https://github.com/user-attachments/assets/704e7d2d-af01-46ee-998f-7342735db1b1)](https://github.com/user-attachments/assets/704e7d2d-af01-46ee-998f-7342735db1b1)\n\n![Project Screenshot](https://github.com/user-attachments/assets/ac3c656e-319e-4f0a-beaa-8aba201b9ef1)\n\n---\n\n## Live Demo\n\n[**Try Translatica Live**](https://bilingual-bridge.onrender.com/)\n\n---\n\n## Technical Stack\n\n| Component        | Technology                                   |\n| ---------------- | -------------------------------------------- |\n| **Training**     | PyTorch, Transformers, PEFT, LoRA, Datasets  |\n| **Inference**    | FastAPI, Uvicorn, Pydantic                   |\n| **Model**        | Helsinki-NLP/opus-mt-en-es (LoRA fine-tuned) |\n| **Frontend**     | React, Vite, Tailwind CSS                    |\n| **Testing**      | Pytest (63 tests, 92% coverage)              |\n| **CI/CD**        | GitHub Actions (Lint → Test → Docker Build)  |\n| **Deployment**   | Docker, Render                               |\n\n---\n\n## System Architecture\n\nTranslatica follows a **modular monolithic architecture** that clearly separates training, inference, API, and frontend layers while maintaining simple deployment and strong production readiness.\n\n### High-Level Architecture\n\n```\n┌──────────────────────────┐\n│        Frontend UI       │\n│   HTML + CSS + JS (UI)   │\n└─────────────┬────────────┘\n              │ HTTP Requests\n              ▼\n┌──────────────────────────┐\n│       FastAPI Server     │\n│  Routing + Validation    │\n└─────────────┬────────────┘\n              │\n              ▼\n┌──────────────────────────┐\n│   Translation Service    │\n│  Preprocess → Inference  │\n└─────────────┬────────────┘\n              │\n              ▼\n┌──────────────────────────┐\n│       Model Manager      │\n│  Load LoRA + Tokenizer   │\n└─────────────┬────────────┘\n              │\n              ▼\n┌────────────────────────────────────┐\n│  LoRA Fine-Tuned Transformer Model │\n│ Helsinki-NLP/opus-mt-en-es (PEFT)  │\n└────────────────────────────────────┘\n```\n\n---\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n- **Python 3.11+**\n- **Node.js 18+** \u0026 **npm**\n- **Git**\n\n---\n\n## Quick Start\n\nThe easiest way to run the full application (Frontend + Backend) is using the unified runner.\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/Md-Emon-Hasan/Translatica.git\n   cd Translatica\n   ```\n\n2. **Setup Backend:**\n   ```bash\n   # Create virtual environment\n   python -m venv venv\n\n   # Activate it\n   # Windows:\n   venv\\Scripts\\activate\n   # Mac/Linux:\n   # source venv/bin/activate\n\n   # Install dependencies\n   pip install -r backend/requirements.txt\n   ```\n\n3. **Setup Frontend:**\n   ```bash\n   cd frontend\n   npm install\n   cd ..\n   ```\n\n4. **Run the Application:**\n   ```bash\n   # Make sure venv is active\n   python run.py\n   ```\n   - **Frontend UI:** [http://localhost:5173](http://localhost:5173)\n   - **Backend API:** [http://localhost:8000](http://localhost:8000)\n\n---\n\n## Project Structure\n\n```\nTranslatica/\n│\n├── .github/                             # GitHub Configuration\n│   └── workflows/\n│       └── main.yml                     # CI/CD Pipeline Configuration\n│\n├── backend/                             # Backend Service (FastAPI \u0026 Training)\n│   ├── app/                                 # Main Application Package\n│   │   ├── api/                             # API Request Handlers\n│   │   │   ├── __init__.py\n│   │   │   └── routes.py                    # Endpoint Definitions\n│   │   ├── core/                            # Core Infrastructure\n│   │   │   ├── __init__.py\n│   │   │   ├── config.py                    # Application Settings\n│   │   │   ├── database.py                  # Database Connection Logic\n│   │   │   └── model.py                     # ML Model Loading \u0026 Management\n│   │   ├── models/                          # Data Models\n│   │   │   ├── __init__.py\n│   │   │   └── translation.py               # Database Schema Models\n│   │   ├── services/                        # Business Logic Layer\n│   │   │   ├── __init__.py\n│   │   │   └── translation.py               # Translation Processing Service\n│   │   ├── utils/                           # Utility Functions\n│   │   │   ├── __init__.py\n│   │   │   └── logger.py                    # Logging Configuration\n│   │   ├── __init__.py\n│   │   └── main.py                          # FastAPI Application Entry Point\n│   ├── data/                                # Persistent Data Storage\n│   │   └── translations.db                  # SQLite Database File\n│   ├── fine-tuned-model/                    # Trained Model Artifacts\n│   │   ├── fine-tuned-model/                # Model Weights and Config\n│   │   │   ├── adapter_config.json\n│   │   │   ├── adapter_model.safetensors\n│   │   │   └── README.md\n│   │   └── fine-tuned-tokenizer/            # Tokenizer Assets\n│   │       ├── source.spm\n│   │       ├── special_tokens_map.json\n│   │       ├── target.spm\n│   │       ├── tokenizer_config.json\n│   │       └── vocab.json\n│   ├── logs/                                # Application Logs\n│   │   └── app.log\n│   ├── notebook/                            # Jupyter Notebooks\n│   │   └── Experiment.ipynb                 # Training Experiments\n│   ├── tests/                               # Test Suite\n│   │   ├── __init__.py\n│   │   ├── conftest.py                      # Test Fixtures\n│   │   ├── test_api.py                      # API Endpoint Tests\n│   │   ├── test_config.py                   # Config Tests\n│   │   ├── test_main.py                     # App Initialization Tests\n│   │   ├── test_model.py                    # Model Manager Tests\n│   │   ├── test_services.py                 # Service Layer Tests\n│   │   ├── test_training_data.py            # Training Data Tests\n│   │   ├── test_training_logger.py          # Training Logger Tests\n│   │   ├── test_training_model.py           # Training Model Tests\n│   │   ├── test_training_train.py           # Training Script Tests\n│   │   └── test_training_trainer.py         # Trainer Tests\n│   ├── training/                            # Model Training Source\n│   │   ├── __init__.py\n│   │   ├── data.py                          # Dataset Loading \u0026 Processing\n│   │   ├── logger.py                        # Training Logger Config\n│   │   ├── model.py                         # Training Model Configuration\n│   │   ├── run_train.py                     # Training Execution Script\n│   │   ├── train.py                         # Main Training Logic\n│   │   └── trainer.py                       # Trainer Setup\n│   ├── Dockerfile                           # Backend Docker Configuration\n│   ├── pyproject.toml                       # Python Project Configuration\n│   ├── requirements.txt                     # Python Dependencies\n│   └── run.py                               # Backend-specific Runner\n│\n├── frontend/                            # Frontend Service (React + Vite)\n│   ├── public/                              # Public Static Assets\n│   │   └── vite.svg\n│   ├── src/                                 # Frontend Source Code\n│   │   ├── assets/                          # Assets\n│   │   │   ├── css/\n│   │   │   │   └── index.css                # Global Styles\n│   │   │   ├── images/\n│   │   │   └── react.svg\n│   │   ├── components/                      # React Components\n│   │   │   ├── layout/                      # Layout Components\n│   │   │   │   ├── Footer.tsx\n│   │   │   │   ├── Header.tsx\n│   │   │   │   └── MainLayout.tsx\n│   │   │   └── ui/                          # UI Components\n│   │   │       └── Features.tsx\n│   │   ├── features/                        # Feature Modules\n│   │   │   └── translator/\n│   │   │       └── TranslatorCard.tsx       # Main Translation Widget\n│   │   ├── hooks/                           # Custom React Hooks\n│   │   │   └── useParticles.tsx             # Background Animation Hook\n│   │   ├── services/                        # API Services\n│   │   │   └── api.ts                       # Backend API Client\n│   │   ├── types/                           # TypeScript Types\n│   │   ├── utils/                           # Frontend Utilities\n│   │   ├── App.css                          # App-specific Styles\n│   │   ├── App.tsx                          # Root Component\n│   │   ├── main.tsx                         # Frontend Entry Point\n│   │   └── vite-env.d.ts                    # Vite Type Definitions\n│   ├── .gitignore\n│   ├── Dockerfile                           # Frontend Docker \n│   ├── eslint.config.js\n│   ├── index.html\n│   ├── package-lock.json\n│   ├── package.json\n│   ├── postcss.config.js \n│   ├── tailwind.config.js                   # Tailwind CSS Configuration\n│   ├── tsconfig.app.json\n│   ├── tsconfig.json\n│   ├── tsconfig.node.json\n│   └── vite.config.ts\n│\n├── .gitignore                           # Git Ignore Rules\n├── app.png                              # Application Screenshot\n├── docker-compose.yml                   # Docker Compose Configuration\n├── LICENSE                              # Project License\n├── README.md                            # Project Documentation\n├── render.yml                           # Render Deployment Configuration\n└── run.py                               # Unified Application Launcher\n```\n\n---\n\n## Development\n\nIf you prefer to run services individually for debugging:\n\n### Backend (FastAPI)\n```bash\ncd backend\n# Ensure venv is active\npython -m uvicorn app.main:app --reload\n```\n\n### Frontend (React + Vite)\n```bash\ncd frontend\nnpm run dev\n```\n\n---\n\n## API Documentation\n\n### Endpoints\n\n| Method | Endpoint     | Description            |\n| ------ | ------------ | ---------------------- |\n| GET    | `/`          | Web UI                 |\n| POST   | `/translate` | Translate text         |\n| GET    | `/health`    | Health check           |\n| GET    | `/docs`      | Swagger UI             |\n\n### Interactive Docs\nOnce running, access the automatic API docs:\n- **Swagger UI:** [http://localhost:8000/docs](http://localhost:8000/docs)\n- **ReDoc:** [http://localhost:8000/redoc](http://localhost:8000/redoc)\n\n---\n\n## Model Training\n\nTo fine-tune the translation model:\n\n### Train the Model\n\n```bash\n# Standard training\npython -m backend.training.train\n\n# Custom parameters\npython -m backend.training.train \\\n    --model-checkpoint \"Helsinki-NLP/opus-mt-en-es\" \\\n    --output-dir \"./fine-tuned-model\" \\\n    --num-epochs 3 \\\n    --batch-size 16\n```\n\n### Training Configuration\n\n| Parameter        | Default                      |\n| ---------------- | ---------------------------- |\n| Base Model       | `Helsinki-NLP/opus-mt-en-es` |\n| Dataset          | `opus_books` (en-es)         |\n| LoRA Rank        | 8                            |\n| LoRA Alpha       | 32                           |\n| Target Modules   | `[\"q_proj\", \"v_proj\"]`       |\n| Trainable Params | ~0.38%                       |\n\n---\n\n## Testing\n\nRun the full backend test suite:\n\n```bash\ncd backend\npytest tests/ -v --cov=app --cov=training --cov-report=term-missing\n```\n\n**Current Coverage:** ~92% (63 tests passed)\n\n---\n\n## Docker Deployment\n\nRun the complete stack with Docker Compose:\n\n```bash\n# Build and start\ndocker-compose up --build\n\n# Run in background\ndocker-compose up -d\n```\n\n---\n\n## Logs\n\nLogs are stored in `logs/` directory:\n- `app.log` - Application logs\n- `training.log` - Training logs\n\n---\n\n## Author\n\n**Md Emon Hasan** \n**Email:** emon.mlengineer@gmail.com | [GitHub](https://github.com/Md-Emon-Hasan) | [LinkedIn](https://www.linkedin.com/in/md-emon-hasan-695483237/) | [WhatsApp](https://wa.me/8801834363533)\n\n---\n\n## License\n\nMIT License - see [LICENSE](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmd-emon-hasan%2Ftranslatica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmd-emon-hasan%2Ftranslatica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmd-emon-hasan%2Ftranslatica/lists"}