Skip to main content

A package for audio transcription and speaker diarization using Whisper and NeMo toolkit

Project description

Fast Whisper Diarizer

Fast Whisper Diarizer is a Python package for audio transcription and speaker diarization using the Whisper model and NeMo toolkit.

Installation

To install the package, run:

pip install fast-whisper-diarizer

Initialization

Before using the diarize_audio function, you need to initialize the models using the initialize_models function. This ensures that the necessary models are loaded and ready for processing.

Example:

from fast_whisper_diarizer import initialize_models

whisper_model_name = "tiny.en"

# Initialize models
initialize_models(whisper_model_name)

Usage

To use the diarize_audio function, you can follow the example below. This function allows you to process audio data for transcription and speaker diarization, accepting both file paths and in-memory bytes data as input.

Example

from fast_whisper_diarizer import diarize_audio

# Example usage with a file path
final_transcript = diarize_audio(
    audio_data="path/to/audio/file.wav",
    whisper_model_name="tiny.en"
)
print(final_transcript)

# Example usage with in-memory bytes data
with open("path/to/audio/file.wav", "rb") as f:
    audio_bytes = f.read()

final_transcript = diarize_audio(
    audio_data=audio_bytes,
    whisper_model_name="tiny.en"
)
print(final_transcript)

Parameters

  • audio_data (str or bytes): The input audio, either as a file path (str) or in-memory bytes data (bytes).
  • whisper_model_name (str): The name of the Whisper model to use for transcription.

Optional Parameters

Parameter Type Default Description
separate_vocals bool True Whether to separate vocals from the audio.
processing_batch_size int 8 Batch size for processing audio.
language_code str None Language code for transcription.
suppress_numeric_tokens bool True Whether to suppress numeric tokens in transcription.
computation_device str 'cpu' Device to use for computation ('cpu' or 'cuda').

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

fast_whisper_diarizer-0.1.10.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

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

fast_whisper_diarizer-0.1.10-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file fast_whisper_diarizer-0.1.10.tar.gz.

File metadata

  • Download URL: fast_whisper_diarizer-0.1.10.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for fast_whisper_diarizer-0.1.10.tar.gz
Algorithm Hash digest
SHA256 024d3d1f3dfa9fa6eec03d84786f4a77408cc791d95aa1d2d29ebe8522fe27d0
MD5 7e2c17b1afbee34f431116ff66049e5a
BLAKE2b-256 c8f264ea4e6eb99ce157bb424b867c1485976d18d8de8b6d3aecb0b0ebd3d321

See more details on using hashes here.

File details

Details for the file fast_whisper_diarizer-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for fast_whisper_diarizer-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4da580a3c05a99e610189f932ed48b197a5f65c02eaeee343ca5cf24b730c007
MD5 b02aeab3972d914c5ef21c3d278d8763
BLAKE2b-256 deb3a85db822c53d3671f432522ced37ecd6e55008d1bac2d7ae1dea6b588e8c

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