Skip to main content
Raw ASR output is often a dense wall of text, making it difficult to read and understand the flow of a conversation. The Automatic Formatting feature solves this by intelligently inserting newlines and double newlines into your transcript based on the duration of pauses between spoken words. This transforms a hard-to-read block of text into a well-structured, easy-to-scan document.

How It Works

The feature is controlled by a single formatting parameter, which accepts a JSON string containing one or both of the following keys:
float
The pause duration (in seconds) required to insert a single newline (\n). This is ideal for shorter, conversational breaks.
float
The pause duration (in seconds) required to insert a double newline (\n\n), effectively creating a new paragraph. This is useful for marking a change in topic or speaker.
The formatting parameter must be sent as a JSON-formatted string within your multipart/form-data request, not as a raw JSON object. We’ll show you how to do this below.

How to Use It

To use this feature, you’ll add the formatting field to your request.

SDK Example

quickstart_format.py

Example Result

Applying formatting makes a huge difference in readability.

Before Formatting

After Formatting

1. Define your formatting rules

In your script, create a dictionary with your desired pause thresholds.

2. Convert the rules to a JSON string

Use Python’s json library to serialize the dictionary into a string.

3. Send the request

Pass the serialized string in the data part of your requests.post call.
A Full Example (quickstart_format.py)
URL Sample Script (quickstart_formatting_url.py)