Transcription

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

Complete transcription result from speech-to-text processing.

Value parameters

confidence

Overall confidence of the transcription

language

Detected or specified language

meta

Source audio metadata

processingTimeMs

Time taken to process (for metrics/monitoring)

text

Full transcription text

timestamps

Word-level timing information (only if enabled)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def averageConfidence: Option[Double]

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

def filterByConfidence(threshold: Double): Transcription

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

def hasTimestamps: Boolean
def maxConfidence: Option[Double]

Get maximum confidence score among timestamped words

Get maximum confidence score among timestamped words

Attributes

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

def minConfidence: Option[Double]

Get minimum confidence score among timestamped words

Get minimum confidence score among timestamped words

Attributes

def speakerSegments: Map[Int, List[(Double, Double)]]

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

def totalDuration: Option[Double]
def uniqueSpeakers: Set[Int]

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

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

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

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product