A Python-based system that captures voice input in real-time, converts speech to text using OpenAI's Whisper model, and classifies user intent using advanced NLP techniques.
Clone or download the project:
cd "Real-Time Audio Intent Classification"
Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On macOS/Linux
# or
venv\Scripts\activate # On Windows
Install required packages:
pip install transformers torch torchaudio datasets pyaudio librosa soundfile sounddevice matplotlib
Note: If you encounter issues with the
wavepackage showing MySQL-python dependency errors, simply exclude it from the installation as it's not needed for this project.
Verify installation:
python -c "import sounddevice, librosa, transformers; print('All packages installed successfully!')"
Execute the main script:
python script.py
Follow the prompts:
Start Jupyter:
jupyter notebook
Open audio-classifier-notebook.ipynb
Run cells sequentially to understand each step of the process
Real-Time Audio Intent Classification/
├── README.md # This file
├── script.py # Main Python script
├── audio-classifier-notebook.ipynb # Jupyter notebook with detailed explanations
├── Real-Time Audio Intent Classification.docx # Project documentation
└── venv/ # Virtual environment (if created)
You can modify the following parameters in scripts.py:
# Audio Settings
SAMPLE_RATE = 16000 # Sample rate for audio recording
SILENCE_THRESHOLD = 0.01 # Volume threshold for silence detection
SILENCE_DURATION = 2 # Seconds of silence before stopping recording
Speech-to-Text: openai/whisper-small
Intent Classification: Serj/intent-classifier
# Record and process audio
audio_data = record_audio_until_silence()
transcribed_text = transcribe_audio(audio_data)
detected_intent = classify_intent_few_shot(transcribed_text)
print(f"Transcription: {transcribed_text}")
print(f"Intent: {detected_intent}")
Input: "I want to buy a new laptop for gaming"
Input: "My internet keeps disconnecting every few minutes"
ConfigParser Error:
wave from the package installation listwave module is sufficientMicrophone Not Detected:
# List available audio devices
python -c "import sounddevice as sd; print(sd.query_devices())"
Model Download Issues:
Permission Errors:
Feel free to contribute to this project by:
If you encounter any issues or have questions:
Enjoy real-time voice intent classification! 🎤🤖
1 commits
Jupyter Notebook
99.4%
A Python-based system that captures voice input in real-time, converts speech to text using OpenAI's Whisper model, and classifies user intent using advanced NLP techniques.
Clone or download the project:
cd "Real-Time Audio Intent Classification"
Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On macOS/Linux
# or
venv\Scripts\activate # On Windows
Install required packages:
pip install transformers torch torchaudio datasets pyaudio librosa soundfile sounddevice matplotlib
Note: If you encounter issues with the
wavepackage showing MySQL-python dependency errors, simply exclude it from the installation as it's not needed for this project.
Verify installation:
python -c "import sounddevice, librosa, transformers; print('All packages installed successfully!')"
Execute the main script:
python script.py
Follow the prompts:
Start Jupyter:
jupyter notebook
Open audio-classifier-notebook.ipynb
Run cells sequentially to understand each step of the process
Real-Time Audio Intent Classification/
├── README.md # This file
├── script.py # Main Python script
├── audio-classifier-notebook.ipynb # Jupyter notebook with detailed explanations
├── Real-Time Audio Intent Classification.docx # Project documentation
└── venv/ # Virtual environment (if created)
You can modify the following parameters in scripts.py:
# Audio Settings
SAMPLE_RATE = 16000 # Sample rate for audio recording
SILENCE_THRESHOLD = 0.01 # Volume threshold for silence detection
SILENCE_DURATION = 2 # Seconds of silence before stopping recording
Speech-to-Text: openai/whisper-small
Intent Classification: Serj/intent-classifier
# Record and process audio
audio_data = record_audio_until_silence()
transcribed_text = transcribe_audio(audio_data)
detected_intent = classify_intent_few_shot(transcribed_text)
print(f"Transcription: {transcribed_text}")
print(f"Intent: {detected_intent}")
Input: "I want to buy a new laptop for gaming"
Input: "My internet keeps disconnecting every few minutes"
ConfigParser Error:
wave from the package installation listwave module is sufficientMicrophone Not Detected:
# List available audio devices
python -c "import sounddevice as sd; print(sd.query_devices())"
Model Download Issues:
Permission Errors:
Feel free to contribute to this project by:
If you encounter any issues or have questions:
Enjoy real-time voice intent classification! 🎤🤖
1 commits
Jupyter Notebook
99.4%