Nahian

Survey cleaning pipeline

Turning free-text survey answers into categories, and measuring how much to trust them.

Question
How can free-text survey answers be sorted into categories, and how far can the results be trusted?
Data
9,400 free-text responses, with spelling variants, mixed languages and blank answers.
Tools
Python
Finished
Result
Categories matched a human check about 85% of the time. The work took 90 hours against a plan of 40.

The question

A research team had 9,400 free-text answers and needed them sorted into categories they could count, along with a clear statement of how far the categories could be trusted.

The data

9,400 responses, with spelling variants, a mix of languages and a lot of blanks. Blank and unreadable answers were set aside and counted rather than guessed.

What I did

I started with hand-written rules for common phrases, then added a simple text classifier checked against a sample I coded by hand, so the accuracy figure comes from a human check and not from the model grading itself.

The plan assumed hand-written rules would cover most answers. They covered about half, so the classifier work more than doubled the effort.

What I found

Most answers fell into eight categories, and agreement with the human check was about 85%. Answers the classifier was unsure about were flagged for manual review rather than guessed.

What I'd do differently

I would test a small classifier on 200 answers in the first week. That would have shown that rules alone would not cover the data, and saved roughly 40 hours of rule-writing that I later threw away. It was a useful result, but it was an expensive way to find it.