Skip to content

A FLASK app that takes in an audio file and performs sentiment analysis on each speaker.

Notifications You must be signed in to change notification settings

sagartv/diarization_sentiment_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions to run code:

  1. Create a new virtual environment using conda/pipenv/any other tool
  2. install the packages in the requirements.txt file using "pip install -r requirements.txt"
  3. Add your OPENAI API KEY and DEEPGRAM API KEY in the .env file at the specified locations.
  4. use python3 app.py to run the app.py file and open the browser on port 3000
  5. Attach an audio file on the landing page and click "Mine Sentiment"
  6. The app will first diarize the audio file, the transcript of it is split and each speaker's text is individually fed into OpenAI's GPT 3.5 for sentiment analysis.
  7. You will then get a personality analysis of each speaker through their speech, along with a Big Five Personality Traits analysis and an accompanying score.

Access on Render:

Link: https://diarization-sentiment-analysis.onrender.com/

Description:

This was an interesting app to build, and I'm glad I got to work with DeepGram's API. The main challenge was setting up DeepGram and OpenAI's api and data structures to line up with each other.

As of this version, the audio file is first transcribed and diarized by DeepGram's API. This transcript is then split up by speaker, and each speaker's speech is individually analyzed by OpenAI's GPT 3.5.

The output contains general analysis of the speaker's tone, psychology and intent, as well as a Big Five Personality analysis, and scores.

To further improve this, I would like to expose GPT to both speakers conversations to give it more context, as well as update to GPT 4. I would also like to be more creative and analytical with the personality analysis.

About

A FLASK app that takes in an audio file and performs sentiment analysis on each speaker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published