# Choices

> UForm for JavaScript

A checkpoint with the byte decoder scores closed sets of single-byte choices in one forward, each item's probabilities summing to one:

```javascript
const { probabilities } = model.textChoose(["keep this candidate?", "expand which neighbour?"], ["yn", "ABCD"], arena);
const [keep, drop] = probabilities.item(0);
```

`import * as uform from 'uform';`

`import { Probabilities } from 'uform';`

## ChooseConfig

Optional per-call settings of [`textChoose`](https://www.unum.cloud/docs/uform/javascript/models.md#textChoose).

```typescript
interface ChooseConfig
```

- `temperatureGroups?` `Uint32Array | number[]`: The question type of each item, below the model's `choiceTemperatureGroups`; absent puts every item in group 0.
- `progress?` `ProgressCallback`: Hears the items scored so far and may stop the call by answering `false`; only a model's own verbs take one.

## Chosen

What one choose call landed.

```typescript
interface Chosen
```

- `probabilities` `Probabilities`: One probability per choice, summing to one per item that offers any.
- `stats` `EncodeStats`: Truncation and token counts.

## Choices

The calibrated choices over the byte decoder.

```typescript
interface Choices
```

Mirrors `uform_choices_t`; absent fields derive.

- `weight?` `number`: The loss weight; absent trains no choices.
- `brierWeight?` `number`: The Brier term's weight beside the soft cross-entropy; absent derives 0.5.

## Probabilities

One probability per choice a choose call landed in its arena, in the choices' order: item `i` spans `offsets[i]` up to `offsets[i + 1]`.

```typescript
class Probabilities extends ArenaView
```

Mirrors the `probabilities` output of `uform_text_choose_t`.

## Probabilities

Made by a verb, never directly.

```typescript
new Probabilities(landed: CompiledChosen)
```

## item

Borrows the probabilities of item [`item`](#item) without copying.

```typescript
item(item: number): Float32Array
```

Binding-only.

## data

Every item's probabilities, end to end.

```typescript
readonly data: Float32Array
```

## offsets

The `count + 1` offsets, the last of them the total.

```typescript
readonly offsets: BigUint64Array
```

