# Sentiment Checker (Docker + Hugging Face Spaces) A minimal interactive web app that performs sentiment analysis using a Hugging Face model. Users can type text, click a button, and instantly receive a prediction. --- ## 🚀 Live Concept - Type text into a box - Click **Check** - Get sentiment (POSITIVE / NEGATIVE) --- ## 🧠 Why This Project Exists Machine learning apps often fail to run across different environments due to: - dependency conflicts - mismatched library versions - complex setup requirements This project demonstrates how Docker solves these issues and enables seamless deployment on Hugging Face Spaces. --- ## 🧰 Tech Stack - Python - FastAPI - Transformers (by Hugging Face) - Docker --- ## 📁 Project Structure ``` . ├── app.py ├── requirements.txt └── Dockerfile ```` --- ## ⚙️ How It Works 1. The frontend is a simple HTML page served by FastAPI 2. User input is sent to the `/predict` endpoint 3. A pre-trained sentiment model processes the text 4. The result is returned and displayed instantly --- ## 🐳 Docker Setup ### Build the image ```bash docker build -t sentiment-app . ```` ### Run the container ```bash docker run -p 7860:7860 sentiment-app ``` Then open: [http://localhost:7860](http://localhost:7860) --- ## 🤗 Deployment (Hugging Face Spaces) This app is designed to run on Hugging Face Spaces using Docker. Steps: 1. Create a new Space 2. Select **Docker** as the SDK 3. Upload project files 4. The app will automatically build and deploy --- ## 💡 Why Docker Matters Without Docker: * Manual installation of dependencies * Version conflicts (e.g., Torch, Transformers) * Inconsistent results across machines With Docker: * Reproducible environment * One-step deployment * Works the same everywhere --- ## ⚠️ Notes * The first run may take longer due to model download * Subsequent requests are much faster --- ## ✅ Key Takeaway Docker enables reliable, reproducible deployment of machine learning applications, making it easy to share and run apps on platforms like Hugging Face Spaces without additional setup. ```