Transcription

org.llm4s.speech.stt.Transcription
final case class Transcription(text: String, language: Option[String], confidence: Option[Double], timestamps: List[WordTimestamp], meta: Option[AudioMeta], processingTime: Option[FiniteDuration])

Complete transcription result from speech-to-text processing.

Value parameters

confidence

Overall confidence of the transcription. May be present even when timestamps is empty (e.g. derived from segment/word metadata while STTOptions.enableTimestamps is false).

language

Detected or specified language

meta

Source audio metadata

processingTime

Time taken to process (for metrics/monitoring)

text

Full transcription text

timestamps

Word-level timing information (only if enabled)

Attributes

Source
SpeechToText.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Get average confidence of all timestamped words Only considers words that have confidence scores

Get average confidence of all timestamped words Only considers words that have confidence scores

Attributes

Source
SpeechToText.scala

Filter timestamps by minimum confidence threshold. Useful for quality control and downstream processing. Only keeps timestamps that have confidence scores >= threshold. Timestamps without confidence scores are excluded.

Filter timestamps by minimum confidence threshold. Useful for quality control and downstream processing. Only keeps timestamps that have confidence scores >= threshold. Timestamps without confidence scores are excluded.

Value parameters

threshold

Minimum confidence score [0.0, 1.0]

Attributes

Returns

New Transcription with filtered timestamps

Source
SpeechToText.scala

Attributes

Source
SpeechToText.scala

Get maximum confidence score among timestamped words

Get maximum confidence score among timestamped words

Attributes

Source
SpeechToText.scala
def meetsQualityThreshold(minConfidence: Double, minWords: Int): Boolean

Check if transcription meets quality thresholds

Check if transcription meets quality thresholds

Value parameters

minConfidence

Minimum overall/average confidence required

minWords

Minimum number of words/timestamps required

Attributes

Returns

true if quality thresholds are met

Source
SpeechToText.scala

Get minimum confidence score among timestamped words

Get minimum confidence score among timestamped words

Attributes

Source
SpeechToText.scala

Get time segments for each speaker (requires diarization and timestamps) Useful for speaker-specific processing or transcription verification

Get time segments for each speaker (requires diarization and timestamps) Useful for speaker-specific processing or transcription verification

Attributes

Returns

Map of speaker ID -> List of (startSec, endSec) tuples

Source
SpeechToText.scala

Attributes

Source
SpeechToText.scala

Get all unique speaker IDs in this transcription (if diarization was enabled)

Get all unique speaker IDs in this transcription (if diarization was enabled)

Attributes

Source
SpeechToText.scala
def wordCount: Int

Get word count (based on timestamps if available, otherwise estimate from text)

Get word count (based on timestamps if available, otherwise estimate from text)

Attributes

Source
SpeechToText.scala
def wordsBySpeaker(speakerId: Int): List[String]

Get all words spoken by a specific speaker (requires diarization)

Get all words spoken by a specific speaker (requires diarization)

Value parameters

speakerId

Speaker ID to filter by

Attributes

Returns

List of words from that speaker in chronological order

Source
SpeechToText.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product