---
title: "Stage 3: Counting and reference corpora"
---

# 3. Counting, word sketches and reference corpora

**13:15–14:00**

You will count words and phrases and see how those counts vary across groups.
A word sketch groups the words that go with a search word by grammar. A reference corpus gives you a baseline for finding words that are unusually frequent in your collection.

Use the [full NHS teaching file](../practice-data/survey-candidates/nhs-fft-patient-feedback/nhs-fft-clean.csv), [Text Lens](../tools/text-lens.html) and the [historical API examples](../practice-data/historical-apis/README.md). [NHS source and licence](../practice-data/survey-candidates/nhs-fft-patient-feedback/SOURCE.md)

## Steps

1. **Guess and count · 7 minutes.** Before opening the data, write down adjectives you expect to go with *staff* in praise and in complaints. Paste:

   > Use nhs-fft-clean.csv under practice-data. Count words in answer, ignoring case. Give me frequency lists with and without common words such as “the” and “and”, and lists of recurring two- and three-word sequences. State how you split the text into words and save the stop-word list. Separately count the number of answers containing the whole word wait by service. Include each service's total number of answers and the rate per 100 answers. Save the tables in outputs/.

2. **Build a word sketch · 8 minutes.** Paste:

   > Build a small word sketch for staff or wait in the NHS answers. Use FFT scores 1–2 (good) and 4–5 (poor) as the two groups and report how many rows are in each. Show candidate collocates with the lines they come from. Group them by their grammatical relation to the search term after checking the lines. Show ambiguous cases separately. Give me ten lines across the two groups to check three collocates and one count by hand. Save the sketch and the evidence lines in outputs/.

   **Check by hand.** In the ten lines, see whether three suggested collocates have the stated relation to the search word. Recount one of them in those lines and compare it with the sketch restricted to those same lines. Check whether the services with the most mentions of *wait* are also the ones with the highest rates.

3. **Check a historical collection · 10 minutes.** Choose a worked query from the historical examples and paste:

   > Read the SOURCE.md for my chosen collection in practice-data/historical-apis/. Make one small request to the public API. Save the raw JSON in outputs/. Write a CSV with year and count or frequency, and make a chart that labels the units. A simple chart in HTML is fine. Say what one value counts and which response field it came from. Give me five records or result links to check. If the endpoint fails, use the saved example and record its date.

   **Check by hand.** Open five results. Read around the match and check its date and record type. Does each one count as the thing you thought you were measuring?

## If you get stuck

Open Text Lens in your browser. Load the NHS file, select the `answer` column and use its counts and lines around a word. For the API activity, open a saved chart, CSV and JSON from the historical examples. You can attach these files to a browser chat. The Library of Congress endpoint for Chronicling America blocked the preflight request, so move to a saved example from another collection if that route stalls.

## If you finish early

Ask your agent how to compare word rates in the NHS comments with a reference corpus. Pick one apparent keyword and read the lines around it in both collections. Check how the choice of reference affects what you can say.
