Skip to content

Latest commit

ย 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ Multilingual Translator & ML Model Evaluation

Python Streamlit NLP Machine Learning Audio

A multilingual Streamlit application combining text translation, transliteration, text-to-speech, voice-to-text, and interactive machine-learning model evaluation.

Overview โ€ข Features โ€ข Translation โ€ข ML Evaluation โ€ข Tech Stack โ€ข Getting Started


โœจ Overview

Multilingual Translator & ML Model Evaluation is a Streamlit-based Python application that brings together two major capabilities in one interface:

๐ŸŒ Multilingual Language Tools

  • Translate text into a selected target language
  • Romanize / transliterate translated text
  • Convert translated text into speech
  • Capture speech and convert it into text

๐Ÿค– Machine Learning Evaluation

  • Clustering with K-Means
  • Regression with Linear Regression
  • Classification with multiple supervised learning algorithms
  • Data preprocessing and feature scaling
  • Imbalanced-data handling with SMOTE
  • Visual evaluation using plots, heatmaps, and confusion matrices

The result is a practical application combining NLP, speech processing, data preprocessing, machine learning, and interactive visualization.


๐Ÿš€ Features

Feature Description
๐ŸŒ Multilingual Translation Translate text into multiple target languages
๐Ÿ”ค Romanization Convert translated text into a more readable Romanized form
๐Ÿ”Š Text-to-Speech Generate audio from translated text
๐ŸŽ™๏ธ Voice-to-Text Capture audio input and convert speech into text
๐Ÿงฉ Clustering Explore K-Means clustering
๐Ÿ“ˆ Regression Train and evaluate Linear Regression models
๐Ÿง  Classification Compare Logistic Regression, Naive Bayes, SVM, and KNN
โš–๏ธ SMOTE Handle imbalanced classification datasets
๐Ÿ“ Feature Scaling Scale numerical features with StandardScaler
๐Ÿ“Š Visualization Generate correlation heatmaps, interactive plots, and confusion matrices

๐ŸŒ Translation Workflow

                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                 โ”‚   User Text / Voiceโ”‚
                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
               โ–ผ                       โ–ผ
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚    Text Input โ”‚       โ”‚  Voice Input  โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚                       โ”‚
               โ”‚                       โ–ผ
               โ”‚              Speech-to-Text
               โ”‚                       โ”‚
               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ–ผ
                  GoogleTranslator
                           โ”‚
                           โ–ผ
                 Translated Text
                           โ”‚
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ–ผ                 โ–ผ
            Transliteration    Text-to-Speech
                  โ”‚                 โ”‚
                  โ–ผ                 โ–ผ
          Romanized Output      Audio Output

๐Ÿ”ค Translation Capabilities

The translation workflow supports:

  • ๐ŸŒ Source-language text input
  • ๐ŸŽฏ Target-language selection
  • ๐Ÿ”ค Romanization / transliteration
  • ๐Ÿ”Š Audio generation through gTTS
  • ๐ŸŽ™๏ธ Voice-to-text input through speech_recognition

The translation component uses GoogleTranslator for language conversion and gTTS for text-to-speech generation.


๐Ÿค– Machine Learning Evaluation

The application also provides an interactive environment for evaluating several machine-learning approaches.

๐Ÿงฉ Clustering

K-Means

Used to group data points based on similarity.

Dataset
   โ”‚
   โ–ผ
Feature Preparation
   โ”‚
   โ–ผ
K-Means Clustering
   โ”‚
   โ–ผ
Cluster Assignments
   โ”‚
   โ–ผ
Interactive Visualization

๐Ÿ“ˆ Regression

Linear Regression

Used for predicting continuous target variables.

The workflow includes:

  • Data preparation
  • Feature/target separation
  • Model training
  • Prediction
  • Evaluation
  • Visualization

๐Ÿง  Classification

The application supports several classification algorithms:

Model Type
Logistic Regression Linear classifier
Naive Bayes Probabilistic classifier
Support Vector Machine Margin-based classifier
KNeighborsClassifier Instance-based classifier

The interface allows models to be trained and evaluated on prepared datasets.


๐Ÿงน Data Preprocessing

Before model evaluation, the application supports several preprocessing steps.

Missing Values

Missing values can be handled during dataset preparation.

Categorical Encoding

Categorical variables are encoded using:

LabelEncoder

Feature Scaling

Numerical features are scaled using:

StandardScaler

Class Balancing

For imbalanced classification datasets, the project applies:

SMOTE

This provides a more balanced training distribution before model evaluation.


๐Ÿ“Š Visualization & Evaluation

The application includes visualization tools for understanding datasets and model performance.

Available Visualizations

  • ๐Ÿ”ฅ Correlation heatmaps
  • ๐Ÿ“Š Interactive Plotly visualizations
  • ๐Ÿ”ฒ Confusion matrices
  • ๐Ÿ“ˆ Model evaluation outputs
  • ๐Ÿงฉ Clustering visualizations
  • ๐Ÿ“‰ Regression evaluation views

๐Ÿง  Application Architecture

                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                 โ”‚     Streamlit UI    โ”‚
                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
           โ”‚                โ”‚                โ”‚
           โ–ผ                โ–ผ                โ–ผ
     Language Tools     ML Workflow      Visualization
           โ”‚                โ”‚                โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”           โ”‚
     โ”‚     โ”‚     โ”‚      โ”‚   โ”‚    โ”‚           โ”‚
     โ–ผ     โ–ผ     โ–ผ      โ–ผ   โ–ผ    โ–ผ           โ–ผ
 Translate TTS  STT   Cluster Regr Class   Charts
     โ”‚                      โ”‚     โ”‚     โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
                    โ–ผ
              Streamlit Output

๐Ÿ› ๏ธ Tech Stack

Python Streamlit NumPy Pandas Scikit-learn imbalanced-learn GoogleTranslator gTTS Speech Recognition Plotly Matplotlib Seaborn Transliterate


๐Ÿ“ Repository Structure

Multiligual_translator/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ images/
โ”œโ”€โ”€ ๐Ÿ Translator.py
โ”œโ”€โ”€ ๐Ÿ“ฆ requirements.txt
โ””โ”€โ”€ ๐Ÿ“˜ README.md

โš™๏ธ Getting Started

1๏ธโƒฃ Clone the Repository

git clone https://github.com/Divakar1326/Multiligual_translator.git
cd Multiligual_translator

2๏ธโƒฃ Create a Virtual Environment

Windows

python -m venv .venv
.venv\Scripts๏ฟฝctivate

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate

3๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

4๏ธโƒฃ Run the Streamlit Application

streamlit run Translator.py

๐Ÿงช Typical Usage

๐ŸŒ Translation

  1. Enter text or provide voice input.
  2. Select a target language.
  3. Translate the input.
  4. View the translated output.
  5. Romanize the translation when available.
  6. Generate audio from the translated result.

๐Ÿค– Model Evaluation

  1. Provide or load a dataset.
  2. Prepare the features.
  3. Apply preprocessing.
  4. Select clustering, regression, or classification.
  5. Train and evaluate the selected model.
  6. Inspect metrics and visualizations.

๐Ÿ“ฆ Core Python Libraries

streamlit
numpy
pandas
matplotlib
seaborn
scikit-learn
imbalanced-learn
gTTS
speech-recognition
transliterate
plotly

The repository's requirements.txt should remain the final source of truth for the exact dependency versions.


๐Ÿง  What This Project Demonstrates

  • ๐ŸŒ Multilingual NLP application development
  • ๐ŸŽ™๏ธ Speech-to-text integration
  • ๐Ÿ”Š Text-to-speech generation
  • ๐Ÿ”ค Transliteration / Romanization
  • ๐Ÿงน Data preprocessing
  • ๐Ÿ“ Feature scaling
  • โš–๏ธ Imbalanced-data handling
  • ๐Ÿค– Classification
  • ๐Ÿ“ˆ Regression
  • ๐Ÿงฉ Clustering
  • ๐Ÿ“Š Interactive visualization
  • ๐Ÿ–ฅ๏ธ Streamlit application development

๐Ÿ”ฎ Future Improvements

Potential extensions include:

  • ๐ŸŒ Add more translation providers or offline translation models
  • ๐Ÿ’ฌ Add translation history
  • ๐ŸŽ™๏ธ Improve real-time voice interaction
  • ๐Ÿง  Add transformer-based NLP models
  • ๐Ÿ“Š Add richer model-comparison dashboards
  • ๐Ÿ“ˆ Add cross-validation and additional evaluation metrics
  • ๐Ÿš€ Deploy the application publicly
  • ๐Ÿงช Add automated tests and validation

โš ๏ธ Notes

  • Internet connectivity may be required for external translation and text-to-speech services.
  • Model results depend on the dataset and preprocessing configuration.
  • Voice recognition quality can vary depending on audio quality and environment.
  • This project is intended for educational and demonstration purposes.

๐Ÿ‘จโ€๐Ÿ’ป Author

Divakar M

B.Tech CSE โ€” Artificial Intelligence & Data Science

AI/ML โ€ข Generative AI โ€ข Python โ€ข NLP โ€ข Machine Learning

GitHub


โญ If you find this project useful, consider starring the repository.

Translate ๐ŸŒ โ€ข Analyze ๐Ÿค– โ€ข Visualize ๐Ÿ“Š

About

Multilingual Streamlit application for translation, transliteration, speech-to-text, text-to-speech, and interactive machine-learning model evaluation.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages