Skip to content
mentoor

Topic 2 of 4 · 4 min read

Coding hundreds of responses consistently

Goal: Code a full set of responses against a fixed codebook and measure agreement on a sample you coded by hand.

Coding means giving each response exactly one label from your frozen codebook, one row at a time, and then checking the labels against a sample you coded by hand.

Check yourself · 1 of 3

Why ask the model to return only an ID and one theme name from a closed list, rather than a written summary?

Choose one answer

Why it matters

A single prompt that says "analyse these 600 comments" produces a summary, not data. Summaries skip rows, blend themes and cannot be recounted. Coding one row per label gives you a table you can filter, count and audit. AI tools can do the repetitive part fast. Your job is to prove the result is trustworthy before you report it.

How to do it

  1. Set up the sheet. One response per row, with an ID column. If you use an assistant inside a spreadsheet, such as the AI function in Google Sheets or Copilot in Excel, the label lands next to the response.
  2. Write a fixed coding prompt. Paste the codebook, then say: "Return exactly one theme name from the list, or Other, or Unclear. Return only the name." A closed list means no invented labels.
  3. Work in batches. Send 20 to 50 rows at a time with their IDs and ask for a table back: ID, theme. Long single runs make models skip or repeat rows.
  4. Check the structure. Does the output have as many rows as the input? Are all labels on the list? Any ID missing or duplicated? These checks are quick and catch many errors.
  5. Hand-code a sample. Label 50 responses yourself, without looking at the AI labels. Then compare.
  6. Measure agreement. Agreement is the share of the sample where you and the model chose the same theme. If you agree on 41 of 50, that is 82 percent. Look at the disagreements by theme: one weak theme usually causes most of them.
  7. Fix the codebook, not the answers. If "Pricing" and "Value" are confused, sharpen the rules, give the new version a name, and recode.

Before and after

Before: "Label these comments by theme." The model replies with a paragraph, new theme names and 87 of 100 rows.

After: "Use only these themes: [list]. For each row ID, return the ID and one theme. Output a table with the same number of rows as I gave you." You check the row count, then compare against your hand-coded sample.

What goes wrong

  • Silent row loss. The model returns fewer rows than you sent and nothing in the text says so. Always count.
  • Drift across batches. Batch 1 and batch 6 treat the same kind of comment differently. Pasting the full codebook with every batch reduces this.
  • Multi-issue responses. "Great support but the app crashes" has two themes. Decide in advance: allow a second label, or code the main one.
  • Trusting agreement from an easy sample. If your 50 rows are all clear cases, high agreement tells you little. Include some hard ones.

Examples

A coding prompt that holds up

"Here is codebook v1: [table]. Label each row below with exactly one theme name from the codebook, or Other, or Unclear. Return a table with columns ID and Theme, and no other text. Rows: ..."

The closed list, the single label and the table-only output make the result checkable.

Reading an agreement result

You hand-coded 50 responses and the model agrees on 41, which is 82 percent. Of the 9 disagreements, 6 are between "Pricing" and "Value for money". The fix is two clearer rules for those themes, then a recode, not a change to 9 rows.

Key points

  • Code one response per row with one label from a closed list, so the result can be filtered and recounted.
  • Send batches of 20 to 50 rows with IDs and check that the number of rows returned equals the number sent.
  • Hand-code a sample of about 50 without looking at the AI labels, then compute the share that match.
  • When agreement is low, look at which themes disagree and sharpen their rules rather than editing labels one by one.
  • Decide before coding how to treat responses that mention two themes.

Common mistakes

  • Letting the model invent new labels instead of forcing a closed list.
  • Not counting the returned rows, so skipped responses go unnoticed.
  • Coding a sample while looking at the AI's labels, which hides disagreement.
  • Fixing individual wrong labels instead of the rule that caused them.

Check yourself · 2 of 3

You send 50 rows and get 46 labelled rows back with no warning. What is the right next step?

Choose one answer

Check yourself · 3 of 3

You coded 50 responses by hand and the model matches you on 40. What is the agreement?

Choose one answer

Practice items, not counted towards your mastery.

Start here

Where to go in your country

  • GDPR.eu (opens in a new tab)
    ArticleFreeEU

    Plain-language entry point to EU personal-data rules that apply to names and emails inside feedback.