Mid - Aspect-Based Sentiment Analysis1735037483
Mid - Aspect-Based Sentiment Analysis1735037483
Objective
Create a functional web-based application that performs Aspect-Based Sentiment Analysis using
Flask for the backend and HTML/CSS/JavaScript for the frontend. The application must include
a trained sentiment analysis model that evaluates multiple aspects (features) of a given text.
Examination Instructions
2. Deliverables:
3. Setup Instructions:
o Students must create the application using Python, Flask, and the required libraries.
o Internet access is allowed only for library installations and Flask documentation but
not for copying solutions.
o Follow the provided problem statement and starter code to structure the project.
Problem Statement
You are tasked with building an Aspect-Based Sentiment Analysis application. The application
must classify sentiments as Positive, Negative, or Neutral for multiple aspects of a given review,
such as Food, Service, and Ambience in restaurant reviews.
1. Train a Machine Learning Model
• Use the sample dataset provided below to classify sentiments for each aspect.
2. Backend Functionality
o Processes the review and predicts the sentiment for predefined aspects.
3. Frontend Requirements
o A Result area to display the sentiment for each aspect (Food, Service, Ambience).
o Dynamically update the Result section with predictions for each aspect.
4. Styling
o Negative: Red
o Neutral: Gray
Starter Code
data = [
("The food was amazing, but the service was slow.", {"Food": "Positive", "Service":
"Negative", "Ambience": "Neutral"}),
("The ambience was delightful, but the food lacked flavor.", {"Food": "Negative",
"Service": "Neutral", "Ambience": "Positive"}),
("The service was excellent, but the place was too noisy.", {"Food": "Neutral",
"Service": "Positive", "Ambience": "Negative"}),
("The food was okay, but the service was terrible.", {"Food": "Neutral", "Service":
"Negative", "Ambience": "Neutral"}),
Project Structure
├── templates/
├── static/
Sample Workflow
o Train a model that predicts the sentiment for predefined aspects (e.g., Food,
Service, Ambience).
o Display the sentiment for each aspect with appropriate color-coded styling.
Hints
Expected Deliverables
• A fully functional web application that predicts the sentiment for multiple aspects of a
given review.