Smart Formatting
Smart Format can automatically format transcripts to improve readability.
smart_format
boolean. Default: false
Try this feature out in our API Playground!
Deepgram's Smart Format feature applies additional formatting to transcripts to optimize them for human readability.
Smart Format capabilities vary between models. When Smart Format is turned on, Deepgram will always apply the best-available formatting for your chosen combination of model, model option and language.
At minimum, Smart Format applies:
- Punctuation
- Paragraphs (for white space delineated languages, such as English or Spanish)
Smart Format has the broadest support for English-language models.
- When using the English Nova or Enhanced general models, Smart Format is capable of formatting things like dates, times, currency amounts, phone numbers, emails, and URLs.
- On other English models, Smart Format will format a smaller set of entities, including dates, times, and numbers.
On non-English models, Smart Format will apply all available formatters for that language. For the majority of languages, this is currently limited to Punctuation and Paragraphs.
Enable Feature
To enable Smart Formatting, when you call Deepgram's API, add a smart_format
parameter in the query string and set it to true
:
smart_format=true
Smart Format enables Deepgram's Punctuation feature. If you've set
smart_format=true
, no need to also setpunctuate=true
.
To transcribe audio from a file on your computer, run the following cURL command in a terminal or your favorite API client.
curl \
--request POST \
--header 'Authorization: Token YOUR_DEEPGRAM_API_KEY' \
--header 'Content-Type: audio/wav' \
--data-binary @youraudio.wav \
--url 'https://api.deepgram.com/v1/listen?smart_format=true'
Replace
YOUR_DEEPGRAM_API_KEY
with your Deepgram API Key.
Results
Once applied, results will appear in the transcript.
Source | Before Smart Format | After Smart Format |
---|---|---|
i'm recording this at eight thirty seven pm on wednesday it's november second twenty twenty two i just ate thirty three grams of pasta and then drank fifty five milliliters of water at three hundred main street then i walked down to one two three southeast main street to get my package with tracking number one z five seven a two b | i'm recording this at eight thirty seven pm on wednesday it's november second twenty twenty two i just ate thirty three grams of pasta and then drank fifty five milliliters of water at three hundred main street then i walked down to one two three southeast main street to get my package with tracking number one z five seven a two b | I'm recording this at 8:37 PM on Wednesday, it's November 2 2022. I just ate 33 grams of pasta, and then drank 55 milliliters of water at 300 Main Street. Then I walked down to 123 Southeast Main Street to get my package with tracking number 1Z57A2B. |
Using No Delay
When using Smart Format with live-streamed audio, if a speaker begins saying a number, Deepgram will wait to return a transcription until the speaker has finished and continues on to non-numerical speech. This behavior ensures numbers have the best possible formatting and are not broken up over multiple chunks. To override this behavior and return results immediately, add the parameter no_delay=true
to your streaming API request.
curl \
--request POST \
--header 'Authorization: Token YOUR_DEEPGRAM_API_KEY' \
--header 'Content-Type: audio/wav' \
--data-binary @youraudio.wav \
--url 'https://api.deepgram.com/v1/listen?smart_format=true&no_delay=true'
Replace
YOUR_DEEPGRAM_API_KEY
with your Deepgram API Key.
Additional Formatters
These formatters are not included in Smart Formatting but may be enabled individually.
Measurements
Read the Measurements documentation.
Dictation
Read the Dictation documentation.
Updated 6 months ago