Skip to content

SudhanshuBlaze/aspect-sense

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AspectSense

AspectSense is a web-based aspect-based sentiment analysis tool that scrapes customer reviews from a Google Maps URL and displays the results on a client-side user interface.

Goals

The main goal of AspectSense is to provide a user-friendly interface to analyze customer reviews of a particular business or location. The tool extracts aspects, descriptors, and polarity of the customer reviews and presents them in an easily readable format. This information can be useful for businesses to understand customer opinions and make improvements to their offerings.

Image Image Credits: Springer

Project Setup

Pre-requisites

  • git
  • pip3
  • node

Step 1: Clone this repository

git clone <repository>

Step 2: Change the work dir

cd <repository>

Server Setup

Step 1: Navigate to the /server directory:

cd server

Step 2: Install requirements

pip3 install -r requirements.txt

Step 3: Add API key

  • Generate OpenAI api key from OpenAI
  • Create .env file in the server directory
  • Add api key in the below format
  • OPENAI_API_KEY=<your_api_key>
  • OPENAI_MODEL_ENGINE=<your_model_engine>

Step 4: Run the server in debug mode

uvicorn app:app --debug

Client Setup

Step 1: Navigate to the /client directory:

cd client

Step 2:install the dependencies:

npm install

Step 3: Start the React client by navigating to the /client directory and running

npm start

Project Setup with Docker

  • Navigate to the root directory of the project and build the Docker images:
docker-compose build
  • Start the containers:
docker-compose up

The React client should be available at http://localhost:3000 and the FastAPI server should be available at http://localhost:8000.

Usage

To use AspectSense, enter a Google Maps URL in the input field and click the "Submit" button. The tool will scrape customer reviews from the URL and display the results in a table format. The table includes columns for the customer reviews, ratings, segmented reviews, aspects with descriptions, and aspects with polarity.

Note: The tool is intended for educational and demonstration purposes only. The scraping of customer reviews from Google Maps may be against Google's terms of service, so use this tool at your own risk.