> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gnani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Improve names and terms

> Help Prisma spell names, brands and domain words correctly: keyterms and other context on Prisma v3.0, word boosting on Prisma v2.5.

Use this when the transcript gets names, brands, product names or domain words wrong even though they are spoken clearly.

## Turn it on

On Prisma v3.0, list the words in `keyterms`. Spelling need not be exact, and phrases and any script are fine. This example uses the sample clip from the [Examples](#examples) below:

```bash cURL theme={null}
curl -o names.wav https://docs.gnani.ai/audio/samples/names-and-terms-hi-IN.wav

curl --request POST \
  --url https://api.vachana.ai/stt/v3 \
  --header "X-API-Key-ID: $GNANI_API_KEY" \
  --form audio_file=@names.wav \
  --form model=prisma-v3.0 \
  --form language_code=hi-IN \
  --form-string 'keyterms=["Inya","प्रियंवदा","NACH mandate","Vachana"]'
```

```python Python theme={null}
import json
import os

import requests

with open("names.wav", "rb") as f:
    r = requests.post(
        "https://api.vachana.ai/stt/v3",
        headers={"X-API-Key-ID": os.environ["GNANI_API_KEY"]},
        files={"audio_file": ("names.wav", f, "audio/wav")},
        data={
            "model": "prisma-v3.0",
            "language_code": "hi-IN",
            "keyterms": json.dumps(["Inya", "प्रियंवदा", "NACH mandate", "Vachana"], ensure_ascii=False),
        },
        timeout=60,
    )
r.raise_for_status()
print(r.json()["transcript"])
```

```javascript Node.js theme={null}
import { readFileSync } from "node:fs";

const form = new FormData();
form.append("audio_file", new Blob([readFileSync("names.wav")], { type: "audio/wav" }), "names.wav");
form.append("model", "prisma-v3.0");
form.append("language_code", "hi-IN");
form.append("keyterms", JSON.stringify(["Inya", "प्रियंवदा", "NACH mandate", "Vachana"]));

const response = await fetch("https://api.vachana.ai/stt/v3", {
  method: "POST",
  headers: { "X-API-Key-ID": process.env.GNANI_API_KEY },
  body: form,
});
if (!response.ok) throw new Error(await response.text());
console.log((await response.json()).transcript);
```

```python Python SDK theme={null}
import os
from gnani.stt import GnaniSTTClient

client = GnaniSTTClient(api_key=os.environ["GNANI_API_KEY"])
result = client.transcribe(
    "names.wav",
    model="prisma-v3.0",
    language_code="hi-IN",
    format="transcribe",  # the API's default for hi-IN; the SDK sends "verbatim" unless you set it
    keywords=["Inya", "प्रियंवदा", "NACH mandate", "Vachana"],  # the SDK calls keyterms "keywords"
)
print(result["transcript"])
```

Prisma v3.0 also takes three other kinds of context, alone or with `keyterms`: `topic` (what the recording is about), `previous_text` (the transcript of the clip just before this one) and `speaker_names` (names that may be spoken). See [Context](https://docs.gnani.ai/api/STT/models/prisma-v3.md#context).

On Prisma v2.5, use word boosting instead: `bias_list` with single words and `bias_score` for the strength. See [By model](#by-model).

## Examples

A synthetic clip (Timbre v3.0, Hindi, 6.6 seconds) with a person's name, two product names and a banking term, transcribed by Prisma v3.0 with `language_code=hi-IN`:

| Listen | What is said |
| - | - |
| <audio controls preload="none" src="https://docs.gnani.ai/audio/samples/names-and-terms-hi-IN.wav" aria-label="Sample clip with names and terms, in Hindi" /> | नमस्ते, मैं Inya से प्रियंवदा बोल रही हूँ। आपका NACH mandate कल Vachana पर रिन्यू हो जाएगा। |

| | Transcript |
| - | - |
| Without `keyterms` | नमस्ते, मैं **India** से **प्रियम्वदा** बोल रही हूँ, आपका NACH mandate कल **वचना** पर **renew** हो जाएगा। |
| With `keyterms=["Inya","प्रियंवदा","NACH mandate","Vachana"]` | नमस्ते, मैं **Inya** से **प्रियंवदा** बोल रही हूँ, आपका NACH mandate कल **Vachana** पर **रिन्यू** हो जाएगा। |

With `keyterms`, the product name *Inya* is no longer heard as *India*, the name is spelled as listed, and *Vachana* is written in Latin letters as listed. The same request gave the same two transcripts each time it was run. Synthetic speech is cleaner than most real recordings, so test on your own audio.

## By interface

The field names are the same on every interface. Only where they go changes.

> [tab] REST
>
> Form fields on [`POST /stt/v3`](https://docs.gnani.ai/api/STT/speech-to-text): `keyterms`, `topic`, `previous_text` and `speaker_names` on Prisma v3.0; `bias_list` and `bias_score` on Prisma v2.5. Send lists as a JSON array (as above) or a comma-separated string.
>
> ```bash theme={null}
> --form 'bias_list=["Vachana","EMI"]' --form bias_score=1.0   # Prisma v2.5
> ```

> [tab] Realtime
>
> Headers on [`WS /stt/v3/stream`](https://docs.gnani.ai/api/STT/stt-websocket), with the same names. In a header, write a list as JSON with non-ASCII text escaped (`json.dumps(["खाता", "NACH mandate"])` in Python does this).
>
> To change the words mid-session, send an `update_settings` frame with the `bias` key. It applies from the next utterance; on Prisma v3.0 it replaces the `keyterms`. `topic`, `previous_text` and `speaker_names` are fixed for the life of the connection.
>
> ```json theme={null}
> {"type": "update_settings", "bias": {"list": ["Vachana", "EMI"], "score": 1.0}}
> ```

> [tab] Batch
>
> Fields in the job's `config` on [Create job](https://docs.gnani.ai/api/STTBatch/Create_Job.md): `keyterms`, `topic` and `speaker_names` on Prisma v3.0 (no `previous_text`); `bias_list` and `bias_score` on Prisma v2.5. Batch accepts fewer combinations; see [Rules and limits](#rules-and-limits).
>
> ```json theme={null}
> "config": {
>   "model": "prisma-v3.0",
>   "language_code": "hi-IN",
>   "topic": "Customer calls about loan repayments and EMI dates",
>   "keyterms": ["NACH mandate", "EMI", "Vachana"]
> }
> ```

## By model

| | Prisma v3.0 | Prisma v2.5 |
| - | - | - |
| Field | `keyterms` | `bias_list`, with `bias_score` |
| What you list | Words or short phrases, any script; spelling need not be exact | Single words, letters only (Latin or Indian scripts) |
| How many | Up to 200 | Up to 100 |
| Strength | Not set; `bias_score` is ignored | `bias_score`: `0.0`, `0.5`, `1.0`, `1.5` or `2.0` |
| Other context | `topic`, `previous_text`, `speaker_names` | None |
| Bad input | REST: `400 INVALID_CONTEXT`. Realtime: an invalid `keyterms` value is ignored. Batch: `400 INVALID_CONFIG` when the job is created. | REST and Realtime: the whole list is ignored and the request still succeeds. Batch: `400 INVALID_CONFIG` when the job is created. |

On Prisma v3.0, `bias_list` is still accepted as the older name of `keyterms`. It is used only when `keyterms` is not sent.

## Rules and limits

| Field | Model | Limit | Interfaces |
| - | - | - | - |
| `keyterms` | v3.0 | Up to 200 words or short phrases | REST, Realtime, Batch |
| `topic` | v3.0 | Up to 1,600 characters, no minimum. Batch: 30 to 1,600. | REST, Realtime, Batch |
| `previous_text` | v3.0 | No minimum; the last 600 characters are used | REST, Realtime |
| `speaker_names` | v3.0 | 1 to 4 names | REST, Realtime, Batch |
| `bias_list` | v2.5 | Up to 100 single words, letters only, no digits, spaces or punctuation | REST, Realtime, Batch |
| `bias_score` | v2.5 | `0.0`, `0.5`, `1.0`, `1.5` or `2.0`. Start at `1.0`. | REST, Realtime, Batch |

**Writing the lists.** Send a list as a JSON array or a comma-separated string; use the JSON form when an item contains a comma. Casing does not matter. A listed word that is not spoken should not appear in the transcript.

**`bias_score` on Prisma v2.5.**

| `bias_score` | Effect |
| - | - |
| `0.0` | Off, the same as leaving it out |
| `0.5` | Light nudge |
| `1.0` | Typical starting point |
| `1.5` | Stronger |
| `2.0` | Maximum |

Raise it only if a word is still missed: a stronger score can make the model write a listed word where it was not spoken. Use word boosting with `format=verbatim`: boost words are spoken-form words, so digits and formatted numbers do not match. Boosting applies when `language_code` is a single language.

**Combining context on Prisma v3.0.** On REST and Realtime, any combination of the four fields works. On Batch, send only one of these: `keyterms`, `topic`, `topic` with `keyterms`, or `speaker_names`. Any other mix returns `400 INVALID_CONFIG` when the job is created.

No context field may contain `<|` or `|>`.

## Things to watch for

* **Context can make results worse.** On some audio, hints lower accuracy. Compare transcripts with and without them on your own recordings before you rely on them.
* **Prisma v2.5 ignores a bad list without telling you.** On REST and Realtime, if any `bias_list` entry breaks the rules, or `bias_score` is not an allowed value, the audio is transcribed without boosting and you still get `200`. If boosting seems to do nothing, check the list first. (Batch rejects the job instead.)
* **Realtime ignores an invalid `keyterms` value** on Prisma v3.0 and transcribes without it.
* **`bias_list` without `bias_score`.** On REST and Realtime boosting stays off unless you send a non-zero `bias_score`. On Batch, `1.0` is used.
* **Prisma v3.0 ignores `bias_score`**, and ignores `bias_list` when `keyterms` is also sent.
* **Prisma v3.0 fields sent to Prisma v2.5.** Realtime ignores `topic`, `previous_text` and `speaker_names`. Batch refuses `keyterms`, `topic` and `speaker_names` with `400 INVALID_CONFIG`. REST: TBC.
* **A mid-session update that is invalid is ignored as a whole**, and the previous settings stay in effect.
* **Romanised output.** With `format=transliterate`, write `keyterms` in Latin letters to match the output.
* **Python SDK.** The SDK calls `keyterms` `keywords`. Its streaming client does not send `topic`, `previous_text`, `speaker_names` or word boosting; connect to the [Realtime WebSocket](https://docs.gnani.ai/api/STT/stt-websocket.md) directly for those.

## Related

> [card] [Context on Prisma v3.0](https://docs.gnani.ai/api/STT/models/prisma-v3.md#context)
>
> `topic`, `previous_text` and `speaker_names` in detail, with examples.

> [card] [Find and replace](https://docs.gnani.ai/api/STT/find-and-replace.md)
>
> Fix the written form after transcription instead of steering recognition.

> [card] [Build a request](https://docs.gnani.ai/api/STT/speech-to-text.md#build-a-request)
>
> Try `keyterms` and word boosting in the request builder.

> [card] [Sample audio](https://docs.gnani.ai/api/introduction/sample-audio.md)
>
> More clips to test with, one per language.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.