# Choices

> UForm for Rust

`use uform::TextChoose;`

`use uform::TextChooseConfig;`

`use uform::Choices;`

## TextChoose

A text forward scoring each item's legal choices; see [`EncodeVerbs::text_choose`](https://www.unum.cloud/docs/uform/rust/encoding.md#text_choose).

```rust
pub struct TextChoose<'config, 'arena, Texts, Choices>
```

Calls `uform_text_choose`.

## TextChooseConfig

The question types and the knobs of [`EncodeVerbs::text_choose`](https://www.unum.cloud/docs/uform/rust/encoding.md#text_choose); [`TextChooseConfig::default`](#TextChooseConfig) puts every item in group zero.

```rust
pub struct TextChooseConfig<'config>
```

Mirrors `uform_text_choose_t`.

- `temperature_groups` `&'config [u32]`: The question type of each item, below the model's `choice_temperature_groups`; empty puts
every item in group zero.
- `progress` `Option<&'config mut ProgressCallback<'config>>`: Reports the items scored and stops wherever it says to; a stopped call reports
[`Status::Cancelled`](https://www.unum.cloud/docs/uform/rust/errors.md#Cancelled) and leaves no outputs.
- `progress_steps` `usize`: Reports the call makes at most, the last at completion; zero derives to ten.
- `stats` `Option<&'config mut TextEncodeStats>`: Where the truncation report lands, overwritten by the call.

Implements: `Default`

## Choices

SearchJev's calibrated choices over the byte decoder: the masked head's byte logits read at a mask byte appended to a state, restricted to the item's legal bytes.

```rust
pub struct Choices
```

Each choice item scores
`−Σ t·log(p) + brier_weight·Σ (p − t)²`, with `p` that restricted softmax and `t` its targets.

Mirrors `uform_choices_t`.

- `weight` `f32`: The loss weight; zero trains no choices.
- `brier_weight` `f32`: The Brier term's weight beside the soft cross-entropy; 0.5.

Implements: `Clone`, `Copy`, `StructuralPartialEq`, `PartialEq`, `Debug`, `Default`

