Short and Sweet is a web application that utilizes machine learning techniques to summarize recurring themes in reviews from the Google Play Store. It presents these themes in bar plots and sentiments of the reviews in pie charts.
-
Start the Application: In the
/src
directory, rundocker-compose up
. -
Access the Web Interface: Visit http://0.0.0.0:3000 in your browser.
-
Enter App URL: Paste the URL of a Google Play Store app into the form field.
-
Set Scraping Parameters: Choose review count and star filter options.
-
View Results: Interact with the plots for detailed insights.
The application runs in a Docker container, simplifying dependency installation. The machine learning models run on CPUs, requiring powerful hardware (e.g., AMD Ryzen 5 6-Core). For less powerful systems, see the cloud deployment instructions.
- Clone the Repository:
git clone [email protected]:bjpietrzak/short_and_sweet.git
- Navigate to the Project Directory:
cd short_and_sweet/src/
- Build the Docker Images:
docker-compose build
Lacking a powerful CPU? Deploy the machine learning models on Google Cloud Platform (GCP).
- Create a GCP Account: Sign up for GCP.
- Set Up a GCP Project: Create a new project and note the project ID.
- Enable Services: Activate Container Registry, Cloud Build, and Cloud Run.
- Install gcloud CLI: Download here.
- Configure gcloud:
gcloud config set project <project-ID>
- Build and Deploy Models: In
src/ai/bertopic
orsrc/ai/distillbert
, run:
gcloud builds submit --tag gcr.io/<project-ID>/inference
and
gcloud run deploy inference --image=gcr.io/<project-ID>/inference:latest --execution-environment=gen2 --region=<region> --project=<project-ID> && gcloud run services update-traffic inference --to-latest
- Update Endpoints: Insert the URL from Cloud Run into
src/backend/app/configs/endpoints.json
. - Comment Out Local AI Services in
src/docker-compose.yaml
. - Launch the Application:
docker-compose up
Here are common errors you might encounter and how to resolve them.
Problem: Deploying the Docker image to the Cloud Run service times out, possibly due to insufficient memory allocation.
Solution:
-
Increase Memory Allocation: Navigate to the Container Registry, select the Docker image you wish to deploy. In the deployment settings, allocate more memory to the container. Setting it to 8GB RAM can be effective.
Steps:
Problem: Experiencing a timeout during the inference phase of the project.
Solution:
-
Increase Backend Timeout Threshold: Edit the
timeout
value in thesrc/backend/app/configs/backend.json
file. Increasing this value allows more time for the inference process to complete without timing out.Modification Example:
"timeout": 420
-
Increase Cloud Run Endpoint Timeout: In the deployment settings of the Cloud Run service, increase the timeout value to allow more time for inference operations.