{"slug": "built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project", "title": "Built a Sentiment Analysis Web App – My First Full-Stack ML Project", "summary": "A developer built a full-stack sentiment analysis web app as their first machine learning project, using a Random Forest model with Scikit-Learn and TF-IDF vectorization on the backend and React on the frontend. The app provides real-time positive or negative predictions with confidence scores and prediction history. The project highlighted challenges including model bias toward positive predictions due to small training data and version conflicts between Colab and local environments.", "body_md": "Hey dev.to 👋\n\nAfter spending a month learning Machine Learning through Andrew Ng’s specialization, I wanted to build something real — not just notebooks.\n\nSo I created a **Sentiment Analysis Web App** — a full-stack project that takes any text and predicts whether it's **Positive** or **Negative**.\n\n###\nWhat I Built\n\n-\n**Frontend**: React with clean, modern UI\n-\n**Backend**: Flask API\n-\n**ML Model**: Random Forest using Scikit-Learn + TF-IDF\n-\n**Features**: Real-time prediction, confidence score, prediction history\n\n###\nTech Stack\n\n- React (frontend)\n- Flask + Flask-CORS (backend)\n- Scikit-Learn (RandomForestClassifier)\n- TF-IDF Vectorizer for text processing\n\n###\nWhat I Learned\n\n-\n**From theory to practice** — Going from notebooks to a real web app was the biggest leap.\n-\n**Connecting frontend and backend** — Handling API calls, CORS, and state management.\n-\n**Model limitations** — Small training data leads to bias. I learned the hard way why pre-trained models or larger datasets matter.\n-\n**Full-stack thinking** — ML is not just about the model. Deployment, UI/UX, and user experience are equally important.\n\n###\nChallenges I Faced\n\n- Version conflicts between Colab and local environment\n- Model bias toward \"Positive\" predictions\n\n###\nProject Structure\n\nsentiment-analysis/\n\n├── backend/ # Flask API + ML model\n\n│ ├── app.py\n\n│ ├── train_model.py\n\n│ └── sentiment_model.pkl\n\n│\n\n└── frontend/ # React application\n\n├── src/\n\n└── package.json\n\n**GitHub Repo**: You can check out the full project here:\n\n[machine-learning-projects](https://github.com/ElchinNasirov/machine-learning-projects)\n\n(Go to `projects/sentiment-analysis/`\n\nfolder)\n\n###\nHow to Run Locally\n\ncd backend\n\npython3 train-model.py\n\npython3 app.py\n\ncd frontend\n\nnpm start\n\n###\nWhat's Next?\n\nI’m continuing to study ML and will be sharing more projects:\n\n- Image classification\n- Recommendation systems\n- More full-stack ML apps\n\nIf you're also learning ML, I'd love to hear your journey in the comments!", "url": "https://wpnews.pro/news/built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project", "canonical_source": "https://dev.to/nasirovelchin/built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project-35f8", "published_at": "2026-05-27 05:21:07+00:00", "updated_at": "2026-05-27 05:22:52.343937+00:00", "lang": "en", "topics": ["machine-learning", "natural-language-processing", "ai-products", "ai-tools", "mlops"], "entities": ["Andrew Ng", "React", "Flask", "Scikit-Learn", "Random Forest", "TF-IDF", "GitHub", "Colab"], "alternates": {"html": "https://wpnews.pro/news/built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project", "markdown": "https://wpnews.pro/news/built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project.md", "text": "https://wpnews.pro/news/built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project.txt", "jsonld": "https://wpnews.pro/news/built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project.jsonld"}}