YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Neural Machine Translation (NMT) Application
This project implements a Neural Machine Translation system that provides real-time translation between Indian languages via a web-based interface. The system uses a transformer-based model and integrates both a frontend (HTML, CSS, JavaScript) and a Flask backend.
Table of Contents
- Project Overview
- Directory Structure
- Setup Instructions
- Running the Application
- Backend Endpoints
- Testing
- Future Enhancements
Project Overview
This application is designed to:
- Allow users to input text and select source and target languages.
- Translate the text using a Neural Machine Translation model.
- Display the translated text in real-time with a user-friendly interface.
The project is divided into two major parts:
- Frontend: A responsive web interface (using HTML, CSS, and JavaScript) for user interaction.
- Backend: A Flask API that handles translation requests and integrates the deep learning model.
Directory Structure
The project is organized under the src folder as follows:
src/
βββ app.py # Main Flask application with API endpoints.
βββ config.py # Configuration settings (model names, paths, hyperparameters).
βββ translation.py # Model loading and translation logic.
βββ fine_tune.py # Script for fine-tuning the NMT model.
βββ templates/
β βββ index.html # Frontend HTML file.
βββ static/
β βββ styles.css # CSS file for styling.
β βββ script.js # JavaScript file for frontend interactions.
βββ tests/
β βββ test_app.py # Test files for unit and integration tests.
βββ README.md # Project documentation.
Setup Instructions
1. Create and Activate a Virtual Environment
To avoid conflicts with system-wide packages, it's recommended to use a virtual environment.
For Windows
python -m venv venv
venv\Scripts\activate
For macOS/Linux
python3 -m venv venv
source venv/bin/activate
2. Install Dependencies
Once the virtual environment is activated, install the required dependencies:
pip install -r requirements.txt
Running the Application
1. Start the Flask Server
Run the following command from the src directory:
python src/app.py
2. Access the Application
Open your web browser and go to:
http://localhost:5000
This will load the user interface where you can input text and select languages for translation.
Backend Endpoints
| Endpoint | Method | Description |
|---|---|---|
/translate |
POST | Accepts input text and returns translated text. |
Testing
To run unit tests, execute:
pytest tests/
Future Enhancements
- Improve model efficiency for faster response times.
- Implement additional language pairs.
- Deploy the application on a cloud platform (AWS, GCP, or Azure).