Skip to content

Translate English text into French and analyze its sentiment (Positive, Negative, Neutral) using Hugging Face’s M2M100 and RoBERTa models, built with Streamlit.

Notifications You must be signed in to change notification settings

techieemike/Sentiment-Language-Translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

🌍 TechieMike Sentiment Translator

Python Streamlit HuggingFace

A simple Streamlit web app that takes English text, translates it into French, and runs sentiment analysis (Positive / Negative / Neutral) — powered by Hugging Face’s M2M100 and RoBERTa models.

✨ Features

✅ Translate English text → French (default, can extend to other languages).

✅ Detect sentiment (Positive / Negative / Neutral).

✅ Clean and interactive Streamlit UI.

✅ Returns results in neat JSON format.

⚙️ Tech Stack

Streamlit → UI framework.

Hugging Face Transformers → NLP models.

facebook/m2m100_418M → Multilingual translation.

cardiffnlp/twitter-xlm-roberta-base-sentiment → Sentiment analysis.

Python 3.9+

📂 Project Structure . ├── app.py # Streamlit UI ├── translator.py # Translation + Sentiment functions ├── requirements.txt # Python dependencies ├── images/ # Screenshots │ ├── capture1.png │ └── capture2.png └── README.md # Documentation

🎥 Watch the Demo on YouTube

🚀 Installation & Setup

Clone the repo

git clone https://github.com/techieemike/Sentiment-Language-Translator.git cd Sentiment-Language-Translator

Create a virtual environment (recommended)

python -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows

Install dependencies

pip install -r requirements.txt

Run the app

streamlit run app.py

or

python -m streamlit run app.py

Open in browser Usually available at 👉 http://localhost:8501/

📝 Example Usage

Input:

I love programming!

Output (JSON):

{ "original_text": "I love programming!", "translated_text": "J'adore la programmation!", "sentiment": "Positive" }

Screenshots

App Home

App Home

Example Result

App Home

📜 License

This project is licensed under the MIT License – see the LICENSE file for details.

🔮 Future Improvements

Add support for other target languages (not just French).

Allow batch translation & sentiment on multiple sentences.

Export results as CSV/Excel for analysis.

Deploy to Streamlit Cloud / Hugging Face Spaces.

👨‍💻 Author
Built by Abikale Michael Raymond (TechieMike)

📬 Connect with Me

About

Translate English text into French and analyze its sentiment (Positive, Negative, Neutral) using Hugging Face’s M2M100 and RoBERTa models, built with Streamlit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published