This project uses the Groq API to analyze the sentiment of reviews provided in an uploaded file (CSV or Excel format). The Flask application reads the file, processes the reviews, and returns the sentiment analysis results.
- Python 3.7 or higher
- Flask
- Pandas
- Groq
- python-dotenv
-
Clone the repository:
git clone https://github.com/Souravbudke/Groq-API-Sentiment-Analysis.git cd Groq-API-Sentiment-Analysis -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.envfile in the root directory of the project. - Add your Groq API key to the
.envfile:GROQ_API_KEY=your_groq_api_key_here
- Create a
-
Start the Flask application:
python app.py
-
The application will run on
http://127.0.0.1:5000.
- Endpoint:
/analyze - Method:
POST - Description: Upload a file (CSV or Excel) containing reviews to analyze their sentiment.
curl -X POST http://127.0.0.1:5000/analyze -F 'file=@path_to_your_file.csv'