liveBook · Manning

Whisper

As explained in Data Analysis with LLMs

whisper-1 is the model identifier for the Whisper speech-transcription model in the OpenAI API.

Whisper is OpenAI’s speech-transcription model. In the API, whisper-1 identifies the model used to convert recorded speech into text, including translation into English. section 7.2.1

A typical transcription workflow involves:

  • Opening an audio file in binary read mode. section 7.2.1
  • Calling the audio transcriptions endpoint with the file reference and model name. section 7.2.1
  • Reading the returned transcript and using it as input for a larger application, such as a voice-driven database interface. section 7.3.4

Transcribing a recorded question

Given an audio_path pointing to a supported recording, open the file and pass it to whisper-1. A short literary quote can produce a readable transcript, while a voice-query application can pass the result to GPT-4o for SQL generation. section 7.2.1 section 7.2.3 section 7.3.4

import openai
client = openai.OpenAI()

with open(audio_path, 'rb') as audio_file:  #1
     #2
    transcription = client.audio.transcriptions.create(
        file=audio_file, model='whisper-1')

Use the compact Python listing to see the complete API call, including binary file opening, the audio transcription endpoint, and whisper-1. section 7.2.1

How Data Analysis with LLMs covers it

How deep it goes
Defines Whisper as a multilingual Transformer model and demonstrates its API call, stopping short of explaining model internals.
Examples
Uses MP3 recordings, a literary quote, microphone input, and a voice interface that queries an SQLite database.
What it assumes
Assumes basic Python and an installed OpenAI library, while introducing binary file handling and the transcription endpoint.
What you can do after
Operate Whisper via OpenAI’s Python library to transcribe supported audio files and feed transcripts into applications.
How it connects
Connects speech transcription with audio data, Python, GPT-4o, SQL, and SQLite database querying.

Also explained in

Compare how 2 books explain Whisper →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Analysis with LLMs. The section links point to the parts of the book it draws on.