How patil-mandar/suggesting-best-courses-using-sentiment-analysis works
Project Type & Purpose
• Full-stack web application that takes a course URL, scrapes its user comments, runs sentiment analysis (CountVectorizer + Random Forest), computes a rating, and presents results via HTML templates.
• No persistent database; data flows in memory.
Main Components
a. User’s Web Browser (Front-end)
• HTML templates (in /templates)
• Static assets (CSS in /static/css)
• Form to enter course URL
b. Flask Application (Backend)
• Entry point: app.py
• Routes/controllers rendering templates and invoking logic
c. Web Scraper Module
• webScraping.py fetches comments from the course URL
d. ML Model Module
• mlmodel.py implements feature extraction (CountVectorizer) and Random Forest prediction
• CountVectorizer.ipynb was used for model development/training (offline)
e. External Services
• Target e-learning site (source of course comments)
• (Offline) Kaggle dataset used for initial model training
Relationships & Data Flow
1. User enters URL → Front-end form submits HTTP POST to a Flask route.
2. Flask route calls webScraping.py → Scrape comments via HTTP requests to external site.
3. Comments passed to mlmodel.py → Vectorized, classified into sentiment categories.
4. Backend aggregates sentiment scores → Computes an overall rating.
5. Flask renders an HTML report template → Embeds results for the user.
Architectural Patterns & Design Principles
• Monolithic MVC-style separation:
– View layer: Jinja2 templates + CSS
– Controller layer: Flask routes in app.py
– Model layer: ML logic in mlmodel.py
• Single responsibility per module: scraper, model, web server
• No external database—transient in-memory data flow