Skip to content

Souravbudke/Groq-API-Sentiment-Analysis

Repository files navigation

Groq API Sentiment Analysis

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.

Requirements

  • Python 3.7 or higher
  • Flask
  • Pandas
  • Groq
  • python-dotenv

Installation

  1. Clone the repository:

    git clone https://github.com/Souravbudke/Groq-API-Sentiment-Analysis.git
    cd Groq-API-Sentiment-Analysis
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required packages:

    pip install -r requirements.txt
  4. Set up environment variables:

    • Create a .env file in the root directory of the project.
    • Add your Groq API key to the .env file:
      GROQ_API_KEY=your_groq_api_key_here
      

Running the Project

  1. Start the Flask application:

    python app.py
  2. The application will run on http://127.0.0.1:5000.

Usage

  • Endpoint: /analyze
  • Method: POST
  • Description: Upload a file (CSV or Excel) containing reviews to analyze their sentiment.

Example Request

curl -X POST http://127.0.0.1:5000/analyze -F 'file=@path_to_your_file.csv'

About

using groq's api analysing the sentiments of the customers Model used : mixtral-8x7b-32768

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages