Skip to content

RJ601/OpenTable-Sentiment-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OpenTable-Sentiment-Analysis

Skills: Web Scrapping, Prompt Engineering, Streamlit, Matplotlib

๐Ÿฝ๏ธ Restaurant Review Analyzer

Restaurant Review Analyzer is a multi-page Streamlit web app that scrapes and analyzes restaurant reviews from OpenTable. It uses the Groq LLM API to extract structured insights about food and staff quality from customer feedback.


๐Ÿง  Key Features

  • ๐Ÿ” Review Dashboard:
    Scrape reviews of a single restaurant, separate comments on food and staff and analyze sentiment on food and staff.

  • ๐Ÿ“Š Competitor Analysis:
    Compare average ratings between two restaurants using visual graphs.

  • ๐ŸŽฏ LLM-Based Analysis:
    Uses structured prompts and LLM output to categorize review content.

  • ๐Ÿงพ Export:
    Saves analysis results as .json and competitor comparison as .jpg.


๐Ÿ—‚๏ธ Project Structure

restaurant-review-analyzer/

|

|-- Dashboard.py # Landing page with sidebar navigation

|-- pages

|-- 1_Reviews_Dashboard.py # Single restaurant review dashboard

|-- 2_Competitor_Analysis_Dashboard.py # Compare two restaurants

|-- util.py # Core logic: scraping, prompting, formatting

|-- requirements.txt

|-- LICENSE

|-- README.md # Project instructions (you are here)


โš™๏ธ Setup Instructions

๐Ÿ” 1. Clone the Repository

git clone https://github.com/RJ601/OpenTable-Sentiment-Analysis.git

cd OpenTable-Sentiment-Analysis

๐Ÿงช 2. Create a Virtual Environment (optional but recommended)

python -m venv env

source env/bin/activate # On Windows: env\Scripts\activate

๐Ÿ“ฆ 3. Install Dependencies

Install the required packages using:

pip install -r requirements.txt

๐Ÿ”‘ 4. Set Up Groq API Key

Login & setup your API key from here (https://console.groq.com/keys)

In the file util.py, find this line:

os.environ['GROQ_API_KEY'] = 'your_api_key_here'

Replace 'your_api_key_here' with your actual Groq API key.

โš™๏ธ 5. Optional Configuration

In util.py, you may also edit:

def scrape_reviews(url, start=1, pages=10):

To change how many pages of reviews you want to scrape.

โ–ถ๏ธ Running the App

Run the Streamlit app from the terminal:

streamlit run Dashboard.py

Youโ€™ll see a sidebar with the following options:

Reviews Dashboard: Analyze one restaurant.

Competitor Analysis Dashboard: Compare two restaurants.

Main_Dashboard

๐Ÿ–ผ๏ธ Output

The Reviews Dashboard will save a .json file with categorized review data and would display the colour-coded reviews on the streamlit dashboard.

Reviews_Dashbard_Form

image

Reviews_Dashbard

Reviews_Dashbard_2

The Competitor Analysis page will generate a .jpg line chart comparing average ratings over time.

Competitor_Analysis_Dashbard_Form

Competitor_Analysis_Output_Image

Competitor_Analysis

๐Ÿ“Œ Notes

This app is specifically built for OpenTable review URLs.

Selenium is used for dynamic scraping โ€” make sure Chrome is installed and chromedriver is properly managed (via webdriver_manager).

All logic is modularized inside util.py to simplify maintenance and upgrades.

๐Ÿ“„ License

This project is licensed under the MIT License.

About

AI-powered app to scrape and analyze OpenTable reviews using LLaMA 3 via Groq.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages