This project utilizes OpenAIβs Whisper for speech recognition and applies sentiment analysis on transcribed text. Whisper is a powerful automatic speech recognition (ASR) system capable of transcribing and understanding audio input with high accuracy.
Python, OpenAI Whisper, Speech Recognition, Sentiment Analysis, Natural Language Processing (NLP), Deep Learning, Audio Processing, Automation, Machine Learning, Voice-to-Text, Real-time Transcription, Command Line Tools, AI
Visual Studio Code: https://code.visualstudio.com/ Python: https://www.python.org/downloads/ Homebrew: https://brew.sh/
Follow these steps to set up Whisper and perform speech recognition and sentiment analysis.
Whisper requires several dependencies, including PyTorch and ffmpeg. Install them before proceeding.
First, install Chocolatey if you havenβt (using admin shell):
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Then, install ffmpeg using:
choco install ffmpeg
Use Homebrew:
brew install ffmpeg
Download the project from GitHub:
git clone https://github.com/codeIntrovert/GDG-APL
cd ./GDG-APL/Create a virtual environment to manage dependencies:
py -m venv env
Activate the virtual environment:
- Windows:
env\Scripts\activate
- Mac/Linux:
source env/bin/activate
pip install -r requirements.txt
To securely store your API key, create a .env file in the project directory and add:
API_KEY=your_gemini_api_key_here
Run the following command to transcribe an audio file:
py src/whisper_main.py
π whisper-project
βββ π env/ # Virtual environment
βββ π models/ # Whisper models (optional)
βββ π data/ # Audio files & transcripts
βββ π whisper_transcribe.py # Speech-to-text script
βββ π sentiment_analysis.py # Sentiment analysis script
βββ π requirements.txt # Dependencies
βββ π README.md # Documentation
βββ π .env # API keys (if needed)
β Ensure you have installed Whisper:
pip install openai-whisper
β
Ensure ffmpeg is installed and available in your systemβs PATH.
Try running:
ffmpeg -version
If not found, reinstall using Chocolatey (Windows) or Homebrew (Mac/Linux).
β
Ensure you are using a correct API key if required (e.g., for GPT-based sentiment analysis). Store it securely in .env.
- Whisper GitHub: https://github.com/openai/whisper
- Chocolatey: https://chocolatey.org/
- Google AI Studio: https://aistudio.google.com/
This project is licensed under the MIT License.
This project is actively being developed, and additional features will be added soon.
Happy Coding! π€β‘οΈππ€