Code Monkey home page Code Monkey logo

conversation_analysis_openai's Introduction

Flask Application for Sentimental Analysis and Speaker Insights

This repository contains a Flask application for analyzing conversations uploaded by users. The application extracts text from uploaded audio files, performs sentiment analysis, and provides insights about the speakers involved in the conversation.

Usage

Prerequisites

  • Python 3.10 installed on your system
  • Virtual environment (optional but recommended)
  • Dependencies installed using pip install -r requirements.txt
  • Environment variables configured in a .env file

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/ridasaleem0/conversation_analysis_openAI.git
  2. Navigate to the project directory:

    cd conversation_analysis_openAI
  3. (Optional) Set up a virtual environment:

    # Create a virtual environment
    python3.10 -m venv venv
    
    # Activate the virtual environment
    # On Windows
    venv\Scripts\activate
    # On macOS/Linux
    source venv/bin/activate
  4. Install the required dependencies:

    pip install -r requirements.txt
  5. Set up your environment variables in a .env file. Include any necessary API keys or configuration settings.

Configuration

Make sure to configure the following environment variables in your .env file. For this assignment, we have provided both keys for testing the flask app.

  • OPENAI_API_KEY: Your OpenAI API key for performing speaker analysis using the GPT model.
  • DEEPGRAM_API_KEY = Your DeepGram API key to transcribe the audio files to text.

Running the Application

Run the Flask application using the following command:

python app.py

The application will start, and you can access it in your web browser at http://localhost:2005.

Uploading Conversations

Users can upload conversation files through the web interface. Supported file formats include text and audio.

Viewing Analysis Results

After uploading a conversation, the application performs sentiment analysis and speaker insights. Users can view the analysis results on the web interface.

Troubleshooting

If you encounter any issues while running the application, try the following troubleshooting steps:

  1. Check Dependencies: Make sure all dependencies are installed correctly by running pip install -r requirements.txt again.
  2. API Keys: Verify that any API keys (such as OpenAI API key) are valid and have the necessary permissions.
  3. File Permissions: Ensure that the Flask application has permission to read and write files in the specified directories, especially for uploaded files.
  4. Logging: Check the application logs for any error messages or exceptions that might provide clues about the issue.
  5. Environment Variables: Double-check the .env file to ensure that all required environment variables are correctly configured.
  6. Network Connectivity: If the application relies on external services (such as Deepgram for audio transcription), ensure that your network connection is stable and not blocked by firewalls. If the issue persists, feel free to open an issue in the GitHub repository for further assistance.

Files

  • app.py: Main Flask application file containing routes and logic for handling uploads and analysis.
  • speaker_analysis_gpt.py: Python module for performing speaker analysis and psychological insights using OpenAI's GPT model.
  • transcribe_audio_deepgram.py: Python module for extracting text from audio files using Deepgram's transcription service.

conversation_analysis_openai's People

Contributors

ridasaleem0 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.