Product-Review-Analyzer is a powerful tool that leverages the DeepSeek-Prover-V2-671B model to analyze product reviews. The application processes review text and extracts pros, cons, provides a concise summary, and determines the overall sentiment.
- Comprehensive Analysis: Extract pros, cons, summary, and sentiment from product reviews
- User-Friendly Interface: Simple and intuitive Streamlit web application
- Structured Output: Results provided in clean JSON format
- High-Quality Insights: Powered by the advanced DeepSeek-Prover-V2-671B model
- Python 3.8 or higher
- A Hugging Face API token
-
Clone the repository:
git clone https://github.com/Nirikshan95/Product-Review-Analyzer.git cd Product-Review-Analyzer -
Create virtual environment and activate
python -m venv venv venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory with your Hugging Face API token:HUGGINGFACE_API_TOKEN=your_token_here
-
Start the Streamlit application:
streamlit run app.py
-
Access the application in your browser (typically at
http://localhost:8501). -
Enter a product review in the text area and click "Analyze".
-
View the structured analysis results including pros, cons, summary, and sentiment.
I've been using this wireless mouse for about a month now. The battery life is impressive, lasting 3 weeks on a single charge. The ergonomic design fits comfortably in my hand, and the precision is spot on. However, the clicking sound is quite loud which can be annoying in quiet environments. Also, the Bluetooth connection occasionally drops when used with multiple devices. Overall, it's a solid product for the price point.
{
"pros": ["Impressive battery life (3 weeks on single charge)", "Ergonomic design", "Comfortable fit", "Precise tracking", "Good value for money"],
"cons": ["Loud clicking sound", "Occasional Bluetooth connection drops with multiple devices"],
"summary": "A reliable wireless mouse with excellent battery life and ergonomics, though with minor issues regarding noise and connectivity.",
"sentiment": "Positive"
}- User Input: The user enters a product review through the Streamlit interface.
- Processing Pipeline:
- The review is formatted using predefined prompt templates in
prompt_template.py llm_interface.pysends the formatted prompt to the DeepSeek-Prover model via Hugging Face APIoutput_parser.pyprocesses the model's response into structured JSONpipeline.pyorchestrates the entire workflow
- The review is formatted using predefined prompt templates in
- Output: The processed results are displayed in the Streamlit app, showing pros, cons, summary, and sentiment analysis.
Product-Review-Analyzer/
├── configs/
│ └── settings.py # Configuration settings
├── src/
│ ├── llm_interface.py # Interface to Hugging Face API
│ ├── output_parser.py # Processes model output to JSON
│ ├── pipeline.py # Main processing pipeline
│ └── prompt_template.py # Templates for model prompts
├── app.py # Streamlit application
├── .env # Environment variables
├── LICENSE # MIT License
├── README.md # This file
└── requirements.txt # Project dependencies
Key dependencies include:
- langchain_huggingface
- streamlit
- langchain
For a complete list, see requirements.txt.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.