Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ragaeeb/paragrafs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Paragrafs uses two fundamental types to represent transcribed audio: Tokens and Segments. Tokens are the smallest unit (individual words), while Segments are collections of tokens that represent logical groupings of speech.Token Type
A Token represents a single word or phrase with timing information. This is the basic building block of all transcriptions.Example
Segment Type
A Segment is a higher-level structure that contains a sequence of related tokens. It extends the Token type by adding atokens array for word-by-word breakdown.
Example
The segment’s
text field contains the complete text, while tokens provides word-level timing granularity.Relationship Between Tokens and Segments
Segments are compositional - they contain both:- Aggregate timing: The
startandendof the entire segment - Granular timing: Individual
tokenswith their own timing information - Full text: The
textfield representing all tokens combined
- Display full paragraphs with
segment.text - Access precise word-level timing with
segment.tokens - Navigate between different granularities as needed
Creating Segments from Tokens
If you have a single token with multi-word text, you can estimate a segment with word-level tokens:The
estimateSegmentFromToken function splits text by whitespace and distributes timing evenly across words.Specialized Token Types
MarkedToken
During processing, tokens can be marked with segment breaks:GroundedToken
When syncing with human-edited text, tokens can be marked as matched or unmatched:Working with Segments
Paragrafs provides utilities for manipulating segments:Merging Segments
Splitting Segments
Next Steps
Paragraph Reconstruction
Learn how tokens are grouped into logical paragraphs
Ground Truth Alignment
Sync AI tokens with human-edited text