# Code open-ended responses

> Turn free-text answers into a categorical variable in five steps: pick the question, generate themes, review them, classify responses, and publish. Recense uses AI for the heavy lifting and gives you full manual override.

*Source:* https://recense.ai/docs/text-coding

## Before you start

- A dataset loaded with at least one text variable.
- An active AI provider — built-in agent or BYOK.

## When to use text coding

When your survey includes open-ended questions ("Why did you choose this brand?", "Describe your experience") and you want to include those responses in cross-tabulations or charts.

## The workflow

1. **Select a text variable in the Text Coding panel.** — Choose the open-ended question you want to code.
2. **Generate themes.** — The AI reads responses and proposes a codebook of themes.
3. **Review and edit themes.** — Rename, merge, split, or add themes manually.
4. **Classify responses.** — The AI assigns each response to one or more themes, with confidence scores.
5. **Review classifications.** — Manually override or correct assignments.
6. **Publish.** — The coded themes become a new categorical variable in your dataset.

## AI-assisted coding

- Theme generation uses the AI to identify patterns across all responses.
- Classification assigns themes per response with a confidence indicator.
- You control the final codebook — the AI proposes, you decide.
- Requires an active AI provider (BYOK or hosted).

## Manual overrides

- Click any response to change its theme assignment.
- Add new themes not suggested by the AI.
- Corrections are preserved if you re-run classification.

## Using coded data

Once published, the new variable appears in the Variables list with type C (Categorical). You can:

- Drag it into tables as rows or columns.
- Cross-tabulate it against demographic or other variables.
- Chart it like any other categorical variable.

## Next steps

- **[Build tables and analysis](/docs/tables-and-analysis)** — Cross-tabulate your coded variable like any other.
- **[Agent recipes](/docs/agent-recipes)** — Prompts that work well for theme review and code consolidation.
- **[Methodology](/docs/methodology)** — How NETs and significance tests treat coded categorical data.
