This is a preview feature. It works in the XRAI app today, and how you set it up may change. Captions are corrected in English only for now.
Speech recognition knows everyday words well, but it can misspell names, medicines and technical terms. A medicine such as apixaban may come out as "a pixa ban", or a colleague's name in a different spelling.
Custom vocabulary is a file that lists your words. The XRAI app uses it in two ways:
- It corrects captions. When a caption has a known misspelling of one of your words, the app shows your spelling instead.
- It tells the speech engine your words in advance, so it is more likely to hear them right in the first place. This works with some engines, including Apple's speech recognition on iPhone, iPad and Mac.
What you need
- The XRAI app on iPhone, iPad, Android, Windows or Mac.
- Your words: the names of people, places and organisations, products, medicines and technical terms. A list or a document is fine.
- An AI assistant such as Claude or ChatGPT, to write the file.
- Somewhere to put the file online, or you can send it to us.
Step 1: Make the file with an AI assistant
- Open the prompt below in Claude or ChatGPT, or copy it into the AI assistant you use.
- Tell the assistant what the vocabulary is for, and paste your words.
- The assistant replies with the file. Save it as vocabulary.json.
Run this prompt in Claude Run this prompt in ChatGPT
Help me make a custom vocabulary file for the XRAI captioning app. The app uses it to spell names and specialist words correctly in live captions.
If I haven't given them yet, first ask me: 1) what it's for (for example a cardiology clinic, a church, a conference), and 2) the words and names to include: people, places, organisations, products, medicines, technical terms. I can paste a list or a document.
Then write one JSON file in exactly this format:
{
"name": "Riverside Cardiology",
"refreshSeconds": 900,
"packs": [{
"kind": "industry",
"pack": {
"name": "Riverside Cardiology",
"kind": "industry",
"language": "en",
"options": { "minScore": 0.88 },
"terms": [
{ "name": "apixaban", "aliases": ["a pixa ban", "apixa ban"] },
{ "name": "Anjali Rao", "aliases": ["Angeli Rao", "Anjali Row"] }
],
"sttHints": {
"text": "Outpatient cardiology clinic. Consultations about heart rhythm and blood thinners.",
"terms": ["apixaban", "Anjali Rao"]
}
}
}]
}
Rules:
- Each term's "name" is the exact spelling the captions should show.
- "aliases" are how speech recognition might wrongly write that term: split into pieces, sound-alike spellings, with and without hyphens. Give 2 to 5. A one-word term is only fixed through its aliases, so it always needs some.
- Never make an alias that is an ordinary word or phrase someone might really say, such as "clear" for Claire or "the way" for The Way Church. A bad alias changes correct captions.
- An alias must not contain its own term's name or be another term's name. For example, "CEA levels" can't be an alias of "CEA level".
- Leave out words that are ordinary and spelt normally. If a name is made only of everyday words (such as Family Room or Our Father), or is a title starting with "The", don't put it in "terms"; put it only in sttHints.terms.
- Put every name in sttHints.terms, most important first, up to 300.
- Keep sttHints.text under 1,000 characters: the setting, the topics, and who speaks.
- Valid JSON only: straight quotes, no comments, no trailing commas.
Before you reply, check every alias against these rules and remove any that break them. Reply with the whole file in one code block and tell me to save it as vocabulary.json.
What's in the file
You can open the file in any text editor to check it or add words. Each of your words is a term:
{ "name": "apixaban", "aliases": ["a pixa ban", "apixa ban"] }
| Part | What it does |
|---|---|
name | The spelling the captions should show. |
aliases | Wrong spellings that the app replaces with the name. A one-word term is corrected only when a caption has one of its aliases exactly. A longer name is also corrected when a caption comes close to it. |
sttHints | The words, and a sentence or two about the setting, that the speech engine is told to expect. |
refreshSeconds | How often the app checks the file for changes, in seconds. 900 is every 15 minutes. |
A real example
This vocabulary was made from the script of a play, for live captions at a theatre. It is in two files: a profile, whose link is the one set in the app, and the word list it points to. Because everything said on stage is in the script, it also changes other spellings of the characters' names, such as Alan to Allen. The play's title, and names made of everyday words, are only given to the speech engine, so ordinary speech is never changed into them.
Check the aliases
Read through the aliases before you use the file. Take out any alias that someone might really say: the app would change it every time. For example, an alias CEA levels for the term CEA level would turn every "CEA levels" into "CEA level". It is better for a word to be missed than for correct captions to be changed.
Step 2: Put the file online
The app reads the file from a link. You can host it yourself, or send it to us.
- Host it yourself. Upload the file to a website or online storage you manage, so it has an address that starts with https://. Open the address in a browser: you should see the file's text, starting with {. A link to a page that previews the file, as many file-sharing services give, doesn't work. The file must be smaller than 2 MB.
- Send it to us. Email vocabulary.json to support@xrai.glass. We put it online and reply with its link.
Anyone with the link can read the file, so leave out anything confidential, such as patients' names.
Step 3: Turn it on in the app
- Tap your picture, then Settings.
- Type caption correction in Search settings.
- Paste the file's link into Caption correction profile URL.
- Turn on Enable caption correction.
The app loads the file within a few seconds. Start a conversation and say some of your words to check that the captions spell them your way. Set up each device that should use the vocabulary in the same way.
The app keeps a copy of the file, so the vocabulary keeps working if the link can't be reached for a while.
Change or turn off the vocabulary
- To change it, edit the file and upload it again to the same address. Devices pick up the new version within about 15 minutes. If we host the file, email us the new version.
- To turn it off, turn off Enable caption correction.
Limits of the preview
- Captions are corrected in English only. In other languages, some speech engines still use your words to recognise them.
- Only the words in your file are corrected. Everything else is captioned as it is heard.
- If the app changes a word it shouldn't, find the alias that matches it and take it out of the file.
We'd like to hear how custom vocabulary works for you: email support@xrai.glass.