Skip to main content

Production-ready transcription and diarization pipeline with parallel processing

Project description

WhisperX-NeMo Pipeline

A production-ready transcription and diarization pipeline with parallel processing.

Features

  • Parallel Processing: Runs Whisper transcription and NeMo diarization simultaneously
  • Multiple Backends: Supports both faster-whisper and WhisperX
  • Speaker Diarization: Uses NeMo MSDD models for accurate speaker identification
  • Audio Source Separation: Optional vocal extraction using Demucs
  • Punctuation Restoration: Automatic punctuation using deep learning models
  • Memory Efficient: Proper GPU memory management and cleanup

Installation

pip install whisperx-nemo-pipeline

With constraints (recommended for production):

pip install whisperx-nemo-pipeline -c constraints.txt

Quick Start

from whisperx_nemo_pipeline import create_transcription_pipeline

# Create pipeline
pipeline = create_transcription_pipeline(
    audio_path="path/to/your/audio.wav",
    model_name="large-v2",
    device="cuda",  # or "cpu"
    stemming=True,  # Enable source separation
    backend="faster_whisper"  # or "whisperx"
)

# Process audio
transcript_path, srt_path, timing_info = pipeline.process()

print(f"Transcript saved to: {transcript_path}")
print(f"Subtitles saved to: {srt_path}")
print(f"Processing took: {timing_info['total_time']:.2f}s")

Advanced Usage

from whisperx_nemo_pipeline import TranscriptionPipeline, TranscriptionConfig

# Custom configuration
config = TranscriptionConfig(
    audio_path="path/to/audio.wav",
    model_name="large-v2",
    device="cuda",
    batch_size=8,
    language="en",  # or None for auto-detection
    stemming=True,
    suppress_numerals=False,
    backend="faster_whisper"
)

# Create pipeline with custom config
pipeline = TranscriptionPipeline(config)

# Process
transcript_path, srt_path, timing_info = pipeline.process()

Configuration Options

  • audio_path: Path to input audio file
  • model_name: Whisper model size ("tiny", "base", "small", "medium", "large-v2")
  • device: Computing device ("cuda" or "cpu")
  • batch_size: Batch size for inference (default: 4)
  • language: Language code or None for auto-detection
  • stemming: Enable audio source separation (default: True)
  • suppress_numerals: Suppress numerical tokens (default: False)
  • backend: "faster_whisper" or "whisperx"

Requirements

  • Python 3.8+
  • CUDA-capable GPU (recommended)
  • See requirements.txt for full dependency list

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whisperx_nemo_pipeline-1.0.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whisperx_nemo_pipeline-1.0.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file whisperx_nemo_pipeline-1.0.0.tar.gz.

File metadata

  • Download URL: whisperx_nemo_pipeline-1.0.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for whisperx_nemo_pipeline-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c9d4005723a9ba9b2ab193785aa0d52a8fcdd25fcbdbb45b181b1dcc5fea27f6
MD5 91bdb27107cb0b4d5a2c50a0c895fd1d
BLAKE2b-256 18d1ce14b14c494cc06f10d11eeed8f9a8e9125fa258d71ca5719dcdbf75e93e

See more details on using hashes here.

File details

Details for the file whisperx_nemo_pipeline-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for whisperx_nemo_pipeline-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4ec1f23a5f8d7a39069294df1060e17600083aa649dd2303ccaec95fcba3281
MD5 eb57c7c531053a664bf990c70a38ef9e
BLAKE2b-256 72cec433ef7ae869c9af50d22696bb371cc00cb4f7cda52df6f79fe0de44f85d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page