Amazon UNA (Universal eNquiry Analyzer) is a web application for intelligent product analysis on Amazon. It leverages advanced NLP and sentiment analysis techniques to answer natural language product queries, summarize customer reviews, and visualize review sentiment and word frequency.
- Product Information Extraction: Retrieve detailed product info from Amazon using ASIN and RapidAPI.
- Natural Language Question Answering: Answer user questions about a product using BERT and FLAN models.
- Sentiment Analysis: Analyze and summarize customer sentiment from reviews.
- Visualizations: Generate sentiment bar plots and word frequency heatmaps from review data.
- Question-Answer History: Store and display previous user queries and responses.
- Interactive Web Interface: Simple Flask-based UI for analysis and visualization.
- Backend: Python, Flask
- NLP/ML: transformers (
BERT,FLAN-T5), torch, pandas - Visualization: matplotlib, seaborn, wordcloud
- Database: MongoDB (via pymongo)
- Other: pyngrok (public tunnel), python-dotenv (env vars)
- Frontend: HTML (Jinja templates), CSS
├── app.py # Main Flask app (routes, plotting, database integration)
├── model.py # ProductAnalyzer class (API calls, NLP, Q&A, sentiment)
├── requirements.txt # Python dependencies
├── templates/
│ ├── index.html # Main web UI
│ └── history.html # Query/response history page
├── static/
│ └── styles.css # Custom styles
│ └── plots/ # Generated plots (created at runtime)
-
Clone the Repository
git clone https://github.com/9keystrokes/Amazon-UNA.git cd Amazon-UNA -
Install Requirements
pip install -r requirements.txt
-
Configure Environment Variables
Create a
.envfile in the root directory with:NGROK_KEY=your_ngrok_key API_KEY=your_rapidapi_key MONGO_URI=your_mongodb_uri -
Run the Application
python app.py
The app will start locally and open a public URL via ngrok.
- Enter a product ASIN and your question.
- The app fetches product details & reviews, analyzes sentiment, answers your question, and visualizes results.
- View your previous queries via the History page.
- Requires valid RapidAPI and MongoDB credentials.
- Supports up to 10 reviews per product for analysis.
- All generated plots are saved to
static/plots/.