Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,11 @@

</details>

| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | Apple <br/> (SFSpeechRecognizer) <br/> | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|---------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 15.34 | 20.69 | 12.58 | 15.4 | 14.69 | 16.89 | 28.42 | 17 |
| earnings22-keywords<br/>(chunk-keywords) | 13.28 | 31.97 | 11.67 | 21.24 | 12.46 | 14.57 | 26.98 | - |
| earnings22-keywords<br/>(file-keywords) | 13.85 | 28.37 | 11.80 | 14.69 | 12.57 | 14.73 | 27.26 | - |
| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | ElevenLabs | Apple <br/> (SFSpeechRecognizer) <br/> | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|------------|---------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 15.34 | 20.69 | 12.58 | 15.4 | 14.69 | 16.89 | 10.53 | 28.42 | 17 |
| earnings22-keywords<br/>(chunk-keywords) | 13.28 | 31.97 | 11.67 | 21.24 | 12.46 | 14.57 | | 26.98 | - |
| earnings22-keywords<br/>(file-keywords) | 13.85 | 28.37 | 11.80 | 14.69 | 12.57 | 14.73 | 9.08 | 27.26 | - |

<br/><br/>

Expand All @@ -576,11 +576,11 @@ If the model predicts 20 keywords and 15 of them match the ground truth, precisi

</details>

| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | Apple <br/> (SFSpeechRecognizer) <br/> | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|-------------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 0.98 | 0.97 | 0.97 | 0.97 | 0.97 | 0.98 | 1 | 0.99 |
| earnings22-keywords<br/>(chunk-keywords) | 0.99 | 0.98 | 0.99 | 0.96 | 0.98 | 0.98 | 0.99 | - |
| earnings22-keywords<br/>(file-keywords) | 0.96 | 0.93 | 0.96 | 0.94 | 0.96 | 0.95 | 0.99 | - |
| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | ElevenLabs | Apple <br/> (SFSpeechRecognizer) <br/> | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|------------|-------------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 0.98 | 0.97 | 0.97 | 0.97 | 0.97 | 0.98 | 0.97 | 1 | 0.99 |
| earnings22-keywords<br/>(chunk-keywords) | 0.99 | 0.98 | 0.99 | 0.96 | 0.98 | 0.98 | | 0.99 | - |
| earnings22-keywords<br/>(file-keywords) | 0.96 | 0.93 | 0.96 | 0.94 | 0.96 | 0.95 | 0.96 | 0.99 | - |

<br/><br/>

Expand All @@ -603,11 +603,11 @@ If the ground-truth transcript has 25 keywords and the model correctly finds 15,

</details>

| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | Apple <br/> (SFSpeechRecognizer) <br/> | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|-------------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 0.61 | 0.53 | 0.55 | 0.53 | 0.47 | 0.45 | 0.26 | 0.39 |
| earnings22-keywords<br/>(chunk-keywords) | 0.89 | 0.7 | 0.69 | 0.77 | 0.85 | 0.82 | 0.45 | - |
| earnings22-keywords<br/>(file-keywords) | 0.83 | 0.79 | 0.68 | 0.82 | 0.82 | 0.8 | 0.4 | - |
| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | ElevenLabs | Apple <br/> (SFSpeechRecognizer) <br/> | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|------------|-------------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 0.61 | 0.53 | 0.55 | 0.53 | 0.47 | 0.45 | 0.75 | 0.26 | 0.39 |
| earnings22-keywords<br/>(chunk-keywords) | 0.89 | 0.7 | 0.69 | 0.77 | 0.85 | 0.82 | | 0.45 | - |
| earnings22-keywords<br/>(file-keywords) | 0.83 | 0.79 | 0.68 | 0.82 | 0.82 | 0.8 | 0.94 | 0.4 | - |

<br/><br/>

Expand All @@ -632,11 +632,11 @@ F1 = 2 × (0.75 × 0.6) / (0.75 + 0.6) = **66.7%**, reflecting the model's overa

</details>

| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | Apple <br/> SFSpeechRecognizer <br/> (Old API) | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|-------------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 0.75 | 0.68 | 0.7 | 0.69 | 0.63 | 0.62 | 0.41 | 0.56 |
| earnings22-keywords<br/>(chunk-keywords) | 0.94 | 0.82 | 0.81 | 0.86 | 0.91 | 0.89 | 0.62 | - |
| earnings22-keywords<br/>(file-keywords) | 0.89 | 0.86 | 0.8 | 0.87 | 0.88 | 0.87 | 0.58 | - |
| Dataset | Deepgram<br/>(nova-3) | OpenAI<br/>(whisper-1) | AssemblyAI | Whisper OSS<br/>(large-v3-turbo) | Argmax<br/>(parakeet-v2) | Argmax<br/>(parakeet-v3) | ElevenLabs | Apple <br/> SFSpeechRecognizer <br/> (Old API) | Apple <br/>(SpeechAnalyzer)|
|--------------------------------------------------|-------------------------|--------------------------|--------------|------------------------------------|----------------------------|----------------------------|------------|-------------------------------------------------|----------------------------|
| earnings22-keywords<br/>(no keywords) | 0.75 | 0.68 | 0.7 | 0.69 | 0.63 | 0.62 | 0.84 | 0.41 | 0.56 |
| earnings22-keywords<br/>(chunk-keywords) | 0.94 | 0.82 | 0.81 | 0.86 | 0.91 | 0.89 | | 0.62 | - |
| earnings22-keywords<br/>(file-keywords) | 0.89 | 0.86 | 0.8 | 0.87 | 0.88 | 0.87 | 0.95 | 0.58 | - |

<br/><br/>

5 changes: 5 additions & 0 deletions config/pipeline_configs/ElevenLabsTranscriptionPipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ElevenLabsTranscriptionPipeline:
config:
model_id: "scribe_v2"
use_keywords: true

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies = [
"openai>=2.7.1",
"meeteval>=0.4.3",
"nemo-toolkit[asr]>=2.6.0",
"elevenlabs>=2.30.0",
]

[project.scripts]
Expand Down
11 changes: 11 additions & 0 deletions src/openbench/pipeline/pipeline_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from .transcription import (
AssemblyAITranscriptionPipeline,
DeepgramTranscriptionPipeline,
ElevenLabsTranscriptionPipeline,
GroqTranscriptionPipeline,
NeMoTranscriptionPipeline,
OpenAITranscriptionPipeline,
Expand Down Expand Up @@ -585,6 +586,16 @@ def register_pipeline_aliases() -> None:
description="AssemblyAI transcription pipeline with keyword boosting support. Requires API key from https://www.assemblyai.com/. Set `ASSEMBLYAI_API_KEY` env var.",
)

PipelineRegistry.register_alias(
"elevenlabs-transcription",
ElevenLabsTranscriptionPipeline,
default_config={
"model_id": "scribe_v2",
"use_keywords": False,
},
description="ElevenLabs transcription pipeline with keyterm prompting support. Requires API key from https://elevenlabs.io/. Set `ELEVENLABS_API_KEY` env var.",
)

################# STREAMING TRANSCRIPTION PIPELINES #################

PipelineRegistry.register_alias(
Expand Down
3 changes: 3 additions & 0 deletions src/openbench/pipeline/transcription/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .common import TranscriptionOutput
from .transcription_assemblyai import AssemblyAITranscriptionPipeline, AssemblyAITranscriptionPipelineConfig
from .transcription_deepgram import DeepgramTranscriptionPipeline, DeepgramTranscriptionPipelineConfig
from .transcription_elevenlabs import ElevenLabsTranscriptionPipeline, ElevenLabsTranscriptionPipelineConfig
from .transcription_groq import GroqTranscriptionConfig, GroqTranscriptionPipeline
from .transcription_nemo import NeMoTranscriptionPipeline, NeMoTranscriptionPipelineConfig
from .transcription_openai import OpenAITranscriptionPipeline, OpenAITranscriptionPipelineConfig
Expand All @@ -29,6 +30,8 @@
"WhisperOSSTranscriptionPipelineConfig",
"DeepgramTranscriptionPipeline",
"DeepgramTranscriptionPipelineConfig",
"ElevenLabsTranscriptionPipeline",
"ElevenLabsTranscriptionPipelineConfig",
"NeMoTranscriptionPipeline",
"NeMoTranscriptionPipelineConfig",
]
85 changes: 85 additions & 0 deletions src/openbench/pipeline/transcription/transcription_elevenlabs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import os
from pathlib import Path
from typing import Callable

from argmaxtools.utils import get_logger
from elevenlabs.client import ElevenLabs
from pydantic import Field

from ...dataset import TranscriptionSample
from ...pipeline import Pipeline, register_pipeline
from ...pipeline_prediction import Transcript
from ...types import PipelineType
from .common import TranscriptionConfig, TranscriptionOutput


logger = get_logger(__name__)

TEMP_AUDIO_DIR = Path("temp_audio_dir")


class ElevenLabsTranscriptionPipelineConfig(TranscriptionConfig):
model_id: str = Field(
default="scribe_v2",
description="The ElevenLabs speech-to-text model to use",
)


@register_pipeline
class ElevenLabsTranscriptionPipeline(Pipeline):
_config_class = ElevenLabsTranscriptionPipelineConfig
pipeline_type = PipelineType.TRANSCRIPTION

def build_pipeline(self) -> Callable[[Path], str]:
api_key = os.getenv("ELEVENLABS_API_KEY")
assert api_key is not None, "Please set ELEVENLABS_API_KEY in environment"

client = ElevenLabs(api_key=api_key)

def transcribe(audio_path: Path) -> str:
with open(audio_path, "rb") as f:
audio_data = f.read()

kwargs = {
"file": audio_data,
"model_id": self.config.model_id,
}

# Add keyterms if available (up to 100, max 50 chars each)
if self.current_keywords:
# Filter keywords to max 50 chars and limit to 100
filtered_keywords = [kw[:50] for kw in self.current_keywords[:100]]
kwargs["keyterms"] = filtered_keywords
logger.debug(f"Using keyterms: {filtered_keywords}")

transcription = client.speech_to_text.convert(**kwargs)

# Remove temporary audio path
audio_path.unlink(missing_ok=True)

return transcription.text

return transcribe

def parse_input(self, input_sample: TranscriptionSample) -> Path:
"""Override to extract keywords from sample before processing."""
self.current_keywords = None
if self.config.use_keywords:
keywords = input_sample.extra_info.get("dictionary", [])
if keywords:
self.current_keywords = keywords

# Warn if force_language is enabled (not currently supported)
if self.config.force_language:
logger.warning(
f"{self.__class__.__name__} does not support language hinting. "
"The force_language flag will be ignored."
)
Comment thread
dbrkn marked this conversation as resolved.
Outdated

return input_sample.save_audio(TEMP_AUDIO_DIR)

def parse_output(self, output: str) -> TranscriptionOutput:
# Split transcript into words
words = output.split() if output else []
transcript = Transcript.from_words_info(words=words)
return TranscriptionOutput(prediction=transcript)
22 changes: 21 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading