Word Alternatives
For transcripts and translations where the model wasn't sure of every word. Hold an underlined word and its alternatives fan out above it.
Needs: Candidate words with probabilities from your recogniser or model (n-best lists, beam search, token logprobs). No model in the browser.
Customize
sample
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| parts | (string | Alternative[])[] | required | The text in order. Strings are plain; an array of { text, p } is an uncertain span, most likely first. Up to 8 candidates show. |
| onChoose | (span: number, choice: Alternative) => void | – | Called when someone corrects a span: its index among the uncertain spans, and what they chose. |
| className | string | – | Class on the text. It inherits font, size and colour, so set type here. |
| style | CSSProperties | – | Style on the text. |