Skip to main content

Overview

Prisma v2.5 is Gnani’s default speech-to-text model. You send it audio of someone speaking, tell it which language to expect, and it returns the words as text. What it gives you:
  • Ten languages. Nine Indian languages and English, each requested by its language code. You send one language code with every request (see Languages).
  • Number formatting. format=transcribe writes numbers, currency, dates, times and phone numbers the way a reader expects, for example ₹5,000 instead of “five thousand rupees” (see Output styles).
  • Word boosting. bias_list and bias_score nudge the model towards brand names and other words it tends to mishear (see Word boosting).
  • Find-and-replace. Rewrite words in the final transcript, for example ok to acknowledged (see Find-and-replace).
Prisma v2.5 is the default. If a request does not choose a model, the API uses Prisma v2.5, so existing integrations keep working unchanged. For automatic language detection (indic-auto), lists of one to four languages, the codemix and transliterate output styles and context hints, see Prisma v3.0. For all models, see Models.

Quick facts

Selecting Prisma v2.5

Prisma v2.5 runs unless you ask for another model. On REST, leave model out: the REST endpoint does not accept gnani-prisma-v2.5 as a value and returns 400 INVALID_MODEL. On Realtime, leave out x-model. On Batch, set config.model to gnani-prisma-v2.5. See Where you can use it. The 3 in /stt/v3 is the URL version, not the model version. How models and URLs relate, and how to select each model, is explained on the Models page. To use Prisma v3.0 instead, add model=prisma-v3.0 to your request. To go back, remove it.

Where you can use it

Gnani offers several ways to send audio. Prisma v2.5 works with all of them.

Try it

This request sends one audio file and asks for Hindi. Replace <API_KEY> with your Gnani API key and clip.wav with your own file (up to 30 seconds).
A successful response looks like this:
The example above shows the main fields. The full field list for the response is on REST transcription.

Languages

Use these codes in language_code (or lang_code when streaming). Each code is a language followed by a region, for example hi-IN for Hindi as spoken in India. Prisma v2.5 does not identify the language for you. You send the language you expect, and the audio is transcribed in it. Automatic detection (indic-auto) is a Prisma v3.0 feature. How you give the language depends on how you send the audio:

Output styles

The same audio can be written two ways. Set it with format (REST) or x-format (Realtime).
  • verbatim is always the default. If you leave out format, you get verbatim, whatever the language.
  • ITN currently works for hi-IN and en-IN only.
  • Not available on Batch. format is a Prisma v3.0 option on Batch, and ITN is not supported there. A Batch job on Prisma v2.5 that sends format returns 400 INVALID_CONFIG.
  • The other two styles belong to Prisma v3.0. codemix and transliterate are not available on Prisma v2.5.

The same clip in both styles

Example output for a clip of someone saying “five thousand rupees” in Hindi (your text will differ):

Digits in the native script

With format=transcribe, set itn_native_numerals=true to write digits in the native script of the language instead of Western digits. It has no effect with verbatim. On REST the field is itn_native_numerals. When streaming, the connection header is also called itn_native_numerals, with no x- prefix. (On Prisma v3.0 the header is x-itn-native-numerals, and it has no effect.)

Output style when streaming

On Prisma v2.5 ITN runs on every transcript segment, straight after recognition. When ITN changes the text, the transcript message also carries output.literal with the text before formatting. For what ITN converts and what it leaves alone, see the ITN reference.

Word boosting

Word boosting nudges the model towards specific words, so they are more likely to be written correctly. Use it for brand names, product names and other terms the model tends to mishear. It changes recognition itself. It is not a find-and-replace. Send both fields together: Start at 1.0 and raise it only if a word is still missed. A stronger score can make the model favour a listed word where it was not spoken.
  • Each entry is one word, letters only. Latin or Indian-script letters. No spaces, digits, punctuation or symbols, so "loan number" and HDFC2 are not allowed.
  • Casing does not matter.
  • Use format=verbatim. Boost words are spoken-form words, so digit strings and formatted numbers will not work.
  • Bad input is skipped, not rejected. On REST and when streaming, if any entry breaks the rules or bias_score is not an allowed value, the whole list is ignored and the audio is transcribed without boosting. You still get a normal response. The exception on REST is a bias_score that is not a number at all (for example abc), which is rejected with 422. On Batch, an invalid list or score is rejected when the job is created (400 INVALID_CONFIG).
  • Works on REST, Realtime and Batch. Streaming uses the headers x-bias-list and x-bias-score, and you can change them mid-session with update_settings. See Word boosting on Realtime and Word boosting on Batch.
Prisma v3.0 replaces this with keyterms (up to 200 words or short phrases), topic, previous_text and speaker_names. See Context.

Find-and-replace

After recognition, and after number formatting if you use it, the API can rewrite words in the final transcript. Use it to standardise terms, for example rs to INR. Each rule has patterns, the strings to find, and replacement, the text to put in their place. Matching ignores case and respects Unicode word boundaries, so ok matches OK but not okay. Rules are applied in a single pass, and longer phrases win over shorter ones.
It works on REST and when streaming (x-enable-substitution and x-substitution-map, which you can change mid-session). It is not supported on Batch. See Find-and-replace on REST and on Realtime for the full rules.

Batch jobs

A Batch job on Prisma v2.5 sets config.model to gnani-prisma-v2.5. The language is identified per file, from up to three codes, and diarization, denoising and webhooks are the same as for every model. Number formatting (ITN), previous_text and find-and-replace are not available on Batch. The full reference is Batch transcription.

What Prisma v2.5 does not do

These are capabilities of Prisma v3.0. They are not available on Prisma v2.5:
  • Automatic language detection (indic-auto) and lists of languages on REST and Realtime. You choose one language. (Batch accepts up to three codes.)
  • detected_language_code in the response.
  • The codemix and transliterate output styles.
  • Context hints: keyterms, topic, previous_text and speaker_names. Prisma v2.5 has word boosting instead.
Some restrictions depend on how you send the audio:
  • REST accepts clips of up to 30 seconds. Use the Batch Jobs API for longer recordings.
  • Realtime streaming is single-language: one lang_code per session.
  • ITN works for hi-IN and en-IN only, and is not available on Batch.

Limits

Request rates and the full table, including Prisma v3.0, are on Limits.

How it differs from Prisma v3.0

The differences are listed in one table on the Prisma v3.0 page: How it differs from Prisma v2.5. Check it before you switch, and send a few representative recordings through both models using the same format.

Next steps