Transformer-based review sentiment analysis and actionable insight generation.
Project description
SentimentScopeAI
Fine-Grained Review Sentiment Analysis & Insight Generation
SentimentScopeAI is a Python-based NLP system that leverages PyTorch and HuggingFace Transformers (pre-trained models) to analyze, interpret, and point out concerns from customer reviews to help companies improve their product/services.
Project Motivation
SentimentScopeAI is designed to answer this one main question:
- What concerns can be derived from a massive set of collective sentiment?
Example:
For <Company Name>'s <Service Name>: overall sentiment is mixed reflecting a balance
of positive and negative feedback
The following specific issues were extracted from negative reviews:
MOST FREQUENT CONCERNS:
1) missed a few appointments (5 customers)
2) not signed into the right account (3 customers)
3) interface is horrible (2 customers)
OTHER CONCERNS:
4) find the interface confusing
5) invitations and acceptances are terrible
System Architecture Overview
Reviews
↓
Pre-trained Transformer (HuggingFace + PyTorch)
↓
Sentiment Signals
↓
Rating Meaning Inference
↓
Summary Generation
Tech-Stack
- Language: Python
- Deep Learning: PyTorch
- NLP Models: HuggingFace Transformers (pre-trained), Flan-T5
- Web Scraping: Playwright, Playwright-Stealth, SeleniumBase
- Aggregated Reasoning: Multi-model ensemble approach
- Data Handling: JSON, Python data structures
Why SentimentScopeAI?
Every organization collects feedback - but reading hundreds or thousands of reviews is time-consuming, inconsistent, and difficult to scale. Important insights are often buried in repetitive comments, while actionable criticism gets overlooked.
SentimentScopeAI is designed to do the heavy lifting:
- Reads and analyzes large volumes of reviews automatically
- Identifies recurring pain points across users
- Pick the one main piece of concern from each review (if there are any)
- Helps teams focus on what to improve rather than sorting through raw text
Installation & Usage
SentimentScopeAI is distributed as a Python package and can be installed via pip:
pip install sentimentscopeai
Requirements:
- Python 3.12.0 or higher (IMPORTANT)
- Internet connection
All required dependencies are automatically installed with the package.
Basic Usage:
from sentimentscopeai import SentimentScopeAI
# MAKE SURE TO PASS IN: <current_folder/file_name.json>, not just <file_name.json> if the following doesn't work
review_bot = SentimentScopeAI("file_name.json", "company_name", "service_name")
print(review_bot.generate_summary())
What Happens Internally
- Reviews are parsed from a structured JSON file
- Sentiment is inferred using pre-trained transformer models (PyTorch + HuggingFace)
- Rating meanings are semantically interpreted
- Flan-T5 finds the negatives from each review and summarizes the whole file
Runtime Analysis
NOTE
- Time Complexity: Θ(N) with empirical R² = 0.998
- Throughput: ~100 reviews/minute
- Benchmark Hardware: NVIDIA RTX 3050 (CUDA-enabled)
- Performance Variance: Execution time scales with GPU capabilities, VRAM, and CUDA compatibility
Important Notice:
1.) JSON Input Format (Required)
SentimentScopeAI only accepts JSON input. The review file must follow this exact structure:
[
"review_text",
"review_text",
"review_text",
...
]
Missing fields, incorrect keys, or non-JSON formats will cause parsing errors.
2.) JSON Must Be Valid
- File must be UTF-8 encoded
- No trailing commas
- No comments
- Must be a list ([]), not a single object
You can use a JSON validator if you are unsure. Check out: [https://jsonlint.com/]
3.) One Company & One Service per JSON File (Required)
This restriction is intentional:
- Sentiment aggregation assumes a single shared context
- Summary generation relies on consistent product-level patterns
- Mixing services can produce misleading summaries and recommendations
If you need to analyze multiple products or companies, create separate JSON files and run SentimentScopeAI independently for each dataset.
4.) Model Loading Behavior
- Transformer models are lazy-loaded
- First run may take longer due to:
- Model downloads
- Tokenizer initialization
- Subsequent runs are significantly faster
This design improves startup efficiency and memory usage.
Web Scraping Feature
SentimentScopeAI now includes an optional automated review import feature that can scrape reviews directly from Yelp for analysis.
Additional Setup for Web Scraping
If you want to use the automated scraping feature, install the required browser:
playwright install chromium
Example Usage (after playwright install chromium)
from sentimentscopeai import SentimentScopeAI
# MAKE SURE TO PASS IN: <current_folder/file_name.json>, not just <file_name.json> if the following doesn't work
review_bot = SentimentScopeAI("file_name.json", "company_name", "service_name")
review_bot.import_yelp_reviews("https://www.yelp.com/biz/business-name-here#reviews")
print(bot.generate_summary())
Supported Platforms
- Yelp Reviews [https://www.yelp.com/]
IMPORTANT NOTES
- Scraping may take several minutes to an hour for businesses with many reviews
- The feature includes anti-detection measures and random delays
- Reviews are automatically cleaned and formatted
- For best results, ensure a stable internet connection
- For faster processing of a large dataset, a dedicated NVIDIA GPU with CUDA is highly recommended
Disclaimer:
SentimentScopeAI is provided as-is and is not liable for any damages arising from its use. All input data is processed locally and is not used for model training or retained beyond execution. Do not include personal, sensitive, or confidential information in review data. SentimentScopeAI may produce incomplete summaries or misclassify sentiment. Always verify critical insights before making business decisions.
Web Scraping Notice: SentimentScopeAI is not affiliated with, endorsed by, or partnered with Yelp Inc. Users are solely responsible for complying with Yelp's Terms of Service and applicable laws. This feature is provided for research and personal use only. Users are responsible for ensuring ethical and appropriate use of this system.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sentimentscopeai-1.5.2.tar.gz.
File metadata
- Download URL: sentimentscopeai-1.5.2.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f4ff2c5fcdba819f60d9e46afa83cea2542263b1901c07c9cb5196341a8675
|
|
| MD5 |
652f1d841180966d40c7e254123205f3
|
|
| BLAKE2b-256 |
1c59f5aad3def9b9c4a03327e961980824ecb1de57a4ec9c579d775df4fff1dd
|
File details
Details for the file sentimentscopeai-1.5.2-py3-none-any.whl.
File metadata
- Download URL: sentimentscopeai-1.5.2-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
005ecce945eab18e0c202aad7dd81ed1f5a4655df253ed660cef271e7dfa447a
|
|
| MD5 |
a28f059984b75d9d84a6b0e4580e40ff
|
|
| BLAKE2b-256 |
996549b9534b2b5da8104df9098172cfb92e764fcbde88a8cec713c5de815908
|