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
Multilingual Translator & ML Model Evaluation is a Streamlit-based Python application that brings together two major capabilities in one interface:
- Translate text into a selected target language
- Romanize / transliterate translated text
- Convert translated text into speech
- Capture speech and convert it into text
- 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.
| 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 |
โโโโโโโโโโโโโโโโโโโโโโ
โ User Text / Voiceโ
โโโโโโโโโโโฌโโโโโโโโโโโ
โ
โโโโโโโโโโโโโดโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ Text Input โ โ Voice Input โ
โโโโโโโโโฌโโโโโโโโ โโโโโโโโโฌโโโโโโโโ
โ โ
โ โผ
โ Speech-to-Text
โ โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโ
โผ
GoogleTranslator
โ
โผ
Translated Text
โ
โโโโโโโโโโดโโโโโโโโโ
โผ โผ
Transliteration Text-to-Speech
โ โ
โผ โผ
Romanized Output Audio Output
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.
The application also provides an interactive environment for evaluating several machine-learning approaches.
Used to group data points based on similarity.
Dataset
โ
โผ
Feature Preparation
โ
โผ
K-Means Clustering
โ
โผ
Cluster Assignments
โ
โผ
Interactive Visualization
Used for predicting continuous target variables.
The workflow includes:
- Data preparation
- Feature/target separation
- Model training
- Prediction
- Evaluation
- Visualization
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.
Before model evaluation, the application supports several preprocessing steps.
Missing values can be handled during dataset preparation.
Categorical variables are encoded using:
LabelEncoderNumerical features are scaled using:
StandardScalerFor imbalanced classification datasets, the project applies:
SMOTEThis provides a more balanced training distribution before model evaluation.
The application includes visualization tools for understanding datasets and model performance.
- ๐ฅ Correlation heatmaps
- ๐ Interactive Plotly visualizations
- ๐ฒ Confusion matrices
- ๐ Model evaluation outputs
- ๐งฉ Clustering visualizations
- ๐ Regression evaluation views
โโโโโโโโโโโโโโโโโโโโโโโ
โ Streamlit UI โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
Language Tools ML Workflow Visualization
โ โ โ
โโโโโโโผโโโโโโ โโโโโผโโโโโ โ
โ โ โ โ โ โ โ
โผ โผ โผ โผ โผ โผ โผ
Translate TTS STT Cluster Regr Class Charts
โ โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโดโโโโโโ
โ
โผ
Streamlit Output
Multiligual_translator/
โ
โโโ ๐ images/
โโโ ๐ Translator.py
โโโ ๐ฆ requirements.txt
โโโ ๐ README.md
git clone https://github.com/Divakar1326/Multiligual_translator.git
cd Multiligual_translatorpython -m venv .venv
.venv\Scripts๏ฟฝctivatepython3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtstreamlit run Translator.py- Enter text or provide voice input.
- Select a target language.
- Translate the input.
- View the translated output.
- Romanize the translation when available.
- Generate audio from the translated result.
- Provide or load a dataset.
- Prepare the features.
- Apply preprocessing.
- Select clustering, regression, or classification.
- Train and evaluate the selected model.
- Inspect metrics and visualizations.
streamlit
numpy
pandas
matplotlib
seaborn
scikit-learn
imbalanced-learn
gTTS
speech-recognition
transliterate
plotly
The repository's
requirements.txtshould remain the final source of truth for the exact dependency versions.
- ๐ 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
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
- 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.
B.Tech CSE โ Artificial Intelligence & Data Science
AI/ML โข Generative AI โข Python โข NLP โข Machine Learning
โญ If you find this project useful, consider starring the repository.
Translate ๐ โข Analyze ๐ค โข Visualize ๐