An advanced Automatic Speech Recognition (ASR) system with multilingual support, focusing on French language accuracy and speaker diarization.
Enhanced language detection with multiple model support:
Enhanced transcription with optimized French language support:
Enhanced speaker diarization with improved clustering:
Specialized translation for multilingual content:
git clone https://github.com/your-username/asr-system.git
cd asr-system
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
.env.template file to .env and update with your HuggingFace token:cp config/.env.template config/.env
# Edit .env with your settings
python main.py process_file --input-file path/to/audio.wav --output-file results.json
python main.py batch_process --input-dir path/to/files --output-dir path/to/results
python main.py start_server --host 0.0.0.0 --port 8000
The system provides a RESTful API for processing audio files:
import requests
# Upload file
with open('audio.wav', 'rb') as f:
response = requests.post('http://localhost:8000/upload', files={'file': f})
file_id = response.json()['file_id']
# Create processing request
config = {
'min_speakers': 1,
'max_speakers': 5,
'language_detection_confidence': 0.6
}
response = requests.post(
'http://localhost:8000/process',
json={'file_id': file_id, 'config': config}
)
task_id = response.json()['task_id']
# Check status
status_response = requests.get(f'http://localhost:8000/status/{task_id}')
status = status_response.json()
# If completed, get results
if status['status'] == 'completed':
result = requests.get(f'http://localhost:8000/result/{task_id}')
transcription = result.json()
The system is highly configurable through config/settings.py:
# Hardware configuration
DEVICE = "cuda" # or "cpu"
NUM_THREADS = 4
BATCH_SIZE = 8
# Model selection
WHISPER_MODEL = "large-v3"
FRENCH_MODEL = "facebook/wav2vec2-large-xlsr-53-french"
DIARIZATION_MODEL = "pyannote/speaker-diarization-3.1"
# Processing parameters
MIN_SPEAKERS = 1
MAX_SPEAKERS = 10
SAMPLE_RATE = 16000
For systems with limited memory, adjust these settings:
# Reduce memory usage
WHISPER_MODEL = "medium" # Use smaller model
BATCH_SIZE = 4 # Process smaller batches
MAX_CACHE_SIZE = 5 * 1024 * 1024 * 1024 # 5GB cache limit
The system is optimized for French language content:
# French optimization settings
OPTIMIZE_FOR_FRENCH = True
FRENCH_MODEL = "facebook/wav2vec2-large-xlsr-53-french"
The system is optimized for GPU processing:
# GPU optimization
DEVICE = "cuda"
GPU_MEMORY_FRACTION = 0.9
For CPU-only systems:
# CPU optimization
DEVICE = "cpu"
NUM_THREADS = 8 # Adjust to your CPU core count
USE_INT8_QUANTIZATION = True # Use quantized models
The system includes advanced memory management:
Out of Memory Errors:
BATCH_SIZE in settingsSlow Processing:
DEVICE="cuda")BATCH_SIZE if memory allowsNUM_THREADS for CPU processingInaccurate Diarization:
MIN_SPEAKERS and MAX_SPEAKERSOVERLAP_THRESHOLD for better detectionThis project is licensed under the MIT License - see the LICENSE file for details.
2 commits
Python
99.5%
An advanced Automatic Speech Recognition (ASR) system with multilingual support, focusing on French language accuracy and speaker diarization.
Enhanced language detection with multiple model support:
Enhanced transcription with optimized French language support:
Enhanced speaker diarization with improved clustering:
Specialized translation for multilingual content:
git clone https://github.com/your-username/asr-system.git
cd asr-system
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
.env.template file to .env and update with your HuggingFace token:cp config/.env.template config/.env
# Edit .env with your settings
python main.py process_file --input-file path/to/audio.wav --output-file results.json
python main.py batch_process --input-dir path/to/files --output-dir path/to/results
python main.py start_server --host 0.0.0.0 --port 8000
The system provides a RESTful API for processing audio files:
import requests
# Upload file
with open('audio.wav', 'rb') as f:
response = requests.post('http://localhost:8000/upload', files={'file': f})
file_id = response.json()['file_id']
# Create processing request
config = {
'min_speakers': 1,
'max_speakers': 5,
'language_detection_confidence': 0.6
}
response = requests.post(
'http://localhost:8000/process',
json={'file_id': file_id, 'config': config}
)
task_id = response.json()['task_id']
# Check status
status_response = requests.get(f'http://localhost:8000/status/{task_id}')
status = status_response.json()
# If completed, get results
if status['status'] == 'completed':
result = requests.get(f'http://localhost:8000/result/{task_id}')
transcription = result.json()
The system is highly configurable through config/settings.py:
# Hardware configuration
DEVICE = "cuda" # or "cpu"
NUM_THREADS = 4
BATCH_SIZE = 8
# Model selection
WHISPER_MODEL = "large-v3"
FRENCH_MODEL = "facebook/wav2vec2-large-xlsr-53-french"
DIARIZATION_MODEL = "pyannote/speaker-diarization-3.1"
# Processing parameters
MIN_SPEAKERS = 1
MAX_SPEAKERS = 10
SAMPLE_RATE = 16000
For systems with limited memory, adjust these settings:
# Reduce memory usage
WHISPER_MODEL = "medium" # Use smaller model
BATCH_SIZE = 4 # Process smaller batches
MAX_CACHE_SIZE = 5 * 1024 * 1024 * 1024 # 5GB cache limit
The system is optimized for French language content:
# French optimization settings
OPTIMIZE_FOR_FRENCH = True
FRENCH_MODEL = "facebook/wav2vec2-large-xlsr-53-french"
The system is optimized for GPU processing:
# GPU optimization
DEVICE = "cuda"
GPU_MEMORY_FRACTION = 0.9
For CPU-only systems:
# CPU optimization
DEVICE = "cpu"
NUM_THREADS = 8 # Adjust to your CPU core count
USE_INT8_QUANTIZATION = True # Use quantized models
The system includes advanced memory management:
Out of Memory Errors:
BATCH_SIZE in settingsSlow Processing:
DEVICE="cuda")BATCH_SIZE if memory allowsNUM_THREADS for CPU processingInaccurate Diarization:
MIN_SPEAKERS and MAX_SPEAKERSOVERLAP_THRESHOLD for better detectionThis project is licensed under the MIT License - see the LICENSE file for details.
2 commits
Python
99.5%