Skip to main content

A flexible plugin system for audio transcription intended to make it easy to add support for multiple backends.

Project description

cjm-transcription-plugin-system

Install

pip install cjm_transcription_plugin_system

Project Structure

nbs/
├── core.ipynb                       # REMOVE-AFTER-OVERHAUL(option-c-cascade): class-identical legacy
├── forced_alignment_core.ipynb      # REMOVE-AFTER-OVERHAUL(option-c-cascade): class-identical legacy
├── forced_alignment_interface.ipynb # Domain-specific plugin interface for word-level audio-text alignment
├── forced_alignment_storage.ipynb   # REMOVE-AFTER-OVERHAUL(option-c-cascade): class-identical legacy
├── plugin_interface.ipynb           # Domain-specific plugin interface for audio transcription
└── storage.ipynb                    # REMOVE-AFTER-OVERHAUL(option-c-cascade): class-identical legacy

Total: 6 notebooks

Module Dependencies

graph LR
    core["core<br/>Core Data Structures (compat shim)"]
    forced_alignment_core["forced_alignment_core<br/>Forced Alignment Core (compat shim)"]
    forced_alignment_interface["forced_alignment_interface<br/>Forced Alignment Plugin Interface"]
    forced_alignment_storage["forced_alignment_storage<br/>Forced Alignment Storage (compat shim)"]
    plugin_interface["plugin_interface<br/>Transcription Plugin Interface"]
    storage["storage<br/>Transcription Storage (compat shim)"]

    forced_alignment_interface --> forced_alignment_core
    plugin_interface --> core

2 cross-module dependencies detected

CLI Reference

No CLI commands found in this project.

Module Overview

Detailed documentation for each module in the project:

Forced Alignment Plugin Interface (forced_alignment_interface.ipynb)

Domain-specific plugin interface for word-level audio-text alignment

Import

from cjm_transcription_plugin_system.forced_alignment_interface import (
    ForcedAlignmentPlugin
)

Classes

class ForcedAlignmentPlugin(PluginInterface):
    """
    Abstract base class for all forced alignment plugins.
    
    Extends PluginInterface with forced-alignment-specific requirements:
    - `supported_formats`: List of audio file extensions this plugin can handle
    - `execute`: Accepts an audio file path and transcript text, returns ForcedAlignResult
    
    Input contract: plugins receive a path to a decodable audio file. Producing a
    model-ready file (format / sample-rate / channel normalization) is the caller's
    responsibility — e.g. an upstream ffmpeg step in the orchestration pipeline —
    not the plugin's. This keeps the interface library dependency-light.
    """
    
    def supported_formats(self) -> List[str]:  # e.g., ['wav', 'mp3', 'flac']
            """List of supported audio file extensions (without the dot)."""
            ...
    
        @abstractmethod
        def execute(
            self,
            audio: Union[str, Path],  # Path to a decodable audio file
            text: str,                # Transcript text to align against
            **kwargs
        ) -> ForcedAlignResult:  # Word-level alignment result
        "List of supported audio file extensions (without the dot)."
    
    def execute(
            self,
            audio: Union[str, Path],  # Path to a decodable audio file
            text: str,                # Transcript text to align against
            **kwargs
        ) -> ForcedAlignResult:  # Word-level alignment result
        "Perform forced alignment of text against audio.

`audio` is a path to a decodable audio file; the caller guarantees it is in
a form the plugin/model can consume."

Transcription Plugin Interface (plugin_interface.ipynb)

Domain-specific plugin interface for audio transcription

Import

from cjm_transcription_plugin_system.plugin_interface import (
    TranscriptionPlugin
)

Classes

class TranscriptionPlugin(PluginInterface):
    """
    Abstract base class for all transcription plugins.
    
    Extends PluginInterface with transcription-specific requirements:
    - `supported_formats`: List of audio file extensions this plugin can handle
    - `execute`: Accepts an audio file path (str or Path), returns TranscriptionResult
    
    Input contract: plugins receive a path to a decodable audio file. Producing a
    model-ready file (format / sample-rate / channel normalization) is the caller's
    responsibility — e.g. an upstream ffmpeg step in the orchestration pipeline —
    not the plugin's. This keeps the interface library dependency-light (no audio
    I/O deps such as numpy/soundfile in the shared consumer environment).
    """
    
    def supported_formats(self) -> List[str]: # e.g., ['wav', 'mp3', 'flac']
            """List of supported audio file extensions (without the dot)."""
            ...
    
        @abstractmethod
        def execute(
            self,
            audio: Union[str, Path], # Path to a decodable audio file
            **kwargs
        ) -> TranscriptionResult: # Transcription result with text, confidence, segments
        "List of supported audio file extensions (without the dot)."
    
    def execute(
            self,
            audio: Union[str, Path], # Path to a decodable audio file
            **kwargs
        ) -> TranscriptionResult: # Transcription result with text, confidence, segments
        "Transcribe audio to text.

`audio` is a path to a decodable audio file; the caller guarantees it is in
a form the plugin/model can consume."

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

cjm_transcription_plugin_system-0.0.36.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file cjm_transcription_plugin_system-0.0.36.tar.gz.

File metadata

File hashes

Hashes for cjm_transcription_plugin_system-0.0.36.tar.gz
Algorithm Hash digest
SHA256 06f9a55fb3de2714d41c6a090e659d3ec178897c3b14bc229b1d6136e9c14870
MD5 637f59a0696f06de8adeb8cf5ac020db
BLAKE2b-256 3d54402cf272938665baa909fd95e78cfc8b8c836b3d7ebc09de5393eff0b0aa

See more details on using hashes here.

File details

Details for the file cjm_transcription_plugin_system-0.0.36-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_transcription_plugin_system-0.0.36-py3-none-any.whl
Algorithm Hash digest
SHA256 080e34cdf64fa2e98d797ef0c5011ef5854895a3c011f52446b0587b8777def9
MD5 3073f4949227e4ea31e709a764835fdc
BLAKE2b-256 5502a1750a0a775a46d1765fd2d503d84be2faa832579997aaeab07d3d2a3187

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