Skip to content

add oak 1, our new medical model - #136

Merged
giorgosHadji merged 1 commit into
mainfrom
add/oak-1/melia/medical
Sep 28, 2026
Merged

giorgosHadji merged 1 commit into
mainfrom
add/oak-1/melia/medical

Conversation

@giorgosHadji

Copy link
Copy Markdown
Contributor

add oak 1, our new medical model

@giorgosHadji

Copy link
Copy Markdown
Contributor Author

tested using:

"""
Manual test script for the "oak-1" model against a Melia batch container.

Submits a job with model=Model.OAK_1 to a locally running (or otherwise
reachable) Melia batch container and prints the transcript, to confirm the
container accepts and runs the new model.

Usage:
    export SPEECHMATICS_BATCH_URL=...
    export SPEECHMATICS_API_KEY=...
    python examples/batch/test_oak_model_container.py [audio_file]
"""

import os
import sys

from speechmatics.batch import Client
from speechmatics.batch import JobConfig
from speechmatics.batch import JobStatus
from speechmatics.batch import JobType
from speechmatics.batch import Model
from speechmatics.batch import TranscriptionConfig

audio_file = sys.argv[1] if len(sys.argv) > 1 else os.path.join(os.path.dirname(__file__), "../example1.wav")

container_url = os.getenv("SPEECHMATICS_BATCH_URL")
wait_seconds = int(os.getenv("WAIT_SECONDS", "120"))


def main() -> None:
    print(f"Submitting {audio_file} to {container_url} with model={Model.OAK_1.value}")

    config = JobConfig(
        type=JobType.TRANSCRIPTION,
        transcription_config=TranscriptionConfig(language="en", model=Model.OAK_1),
    )

    with Client(url=container_url, api_key=os.getenv("SPEECHMATICS_API_KEY", "dummy")) as client:
        job = client.submit_job(audio_file, config=config, wait=wait_seconds)
        print(f"Job {job.id} came back with status: {job.status.value}")

        if job.status == JobStatus.DONE and job.transcript is not None:
            print(f"Transcript: {job.transcript.transcript_text}")
        elif job.status == JobStatus.DONE:
            print(f"Transcript: {client.get_transcript(job.id).transcript_text}")
        else:
            print(f"Still running after {wait_seconds}s, polling until done.")
            result = client.wait_for_completion(job.id, polling_interval=2.0, timeout=None)
            print(f"Transcript: {result.transcript_text}")


if __name__ == "__main__":
    main()
python3 test_oak_model_container.py medical_terms.wav 
Submitting with model=oak-1
Job i8dmzdo97e came back with status: done
Transcript: Have you tried **Acuvail** after your cataract surgery and how's your recovery going so far? Have you been taking **Campral** regularly to help with alcohol dependence?

@rakeshv247 rakeshv247 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giorgosHadji
giorgosHadji merged commit 934167b into main Sep 28, 2026
28 checks passed
@giorgosHadji
giorgosHadji deleted the add/oak-1/melia/medical branch September 28, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants