# Choices

> text_choose(texts, choices, ..) scores each item's legal choices, one byte each, through one forward, and answers a tape_view<float> of one probability per choice that sums to one per item.

`#include <uform/encode.hpp>` 4.0.0-rc.1 · c58749fe

`text_choose(texts, choices, ..)` scores each item’s legal choices, one byte each, through one forward, and answers a `tape_view<float>` of one probability per choice that sums to one per item:

```cpp
std::uint32_t const groups[] = {0, 1};
auto [probabilities, status] = model.text_choose(states, choices, {.temperature_groups = groups}, arena);
std::span<float const> const expand = probabilities.entry(1); // the probabilities of 'A' through 'D'
```

Each group is a question type below the model’s `choice_temperature_groups`, and a model without the byte decoder answers `status_code_t::unsupported_k`.

## API

### Types

#### `text_choose_config_t`

The knobs of [`text_choose`](https://www.unum.cloud/docs/uform/cpp/models.md#text_choose).

[encode.hpp:111 ↗](https://github.com/unum-cloud/UForm/blob/c58749fe4bb208356cc78a87357ab007041c515b/cpp/uform/encode.hpp#L111)

```cpp
struct text_choose_config_t
```

#### Fields

| `temperature_groups` | `std::span<std::uint32_t const>` | The question type of each item, below the model's `choice_temperature_groups`; empty puts every item in group zero. |
| - | - | - |
| `progress` | `progress_t` | Hears the items scored, and may cancel the call. |
| `stats` | `uform_text_encode_stats_t *` | The report the call overwrites; `nullptr` skips it. |
