cat-survey
Survey response classification powered by LLMs. A thin, survey-specific wrapper around cat-stack.
cat-survey adds survey-specific prompt framing ("A respondent was asked: ...") on top of the domain-agnostic cat-stack engine — giving LLMs the context that responses come from a survey instrument.
Installation
pip install cat-survey
With optional extras:
pip install "cat-survey[pdf]" # PDF survey processing
pip install "cat-survey[embeddings]" # Embedding-based similarity scoring
pip install "cat-survey[agent]" # Claude-subscription backend (model_source="claude-agent")
pip install "cat-survey[codex-agent]" # ChatGPT-subscription backend (model_source="codex-agent")
The subscription backends authenticate through your Claude or ChatGPT plan instead of a metered API key — pass model_source="claude-agent" (or "codex-agent") and leave api_key unset. model_source="claude-code" (the Claude Code CLI, if installed) needs no extra at all.
Quick Start
Classify survey responses
import catsurvey
results = catsurvey.classify(
input_data=["I feel great about the program", "It was a waste of time"],
categories=["Positive", "Negative", "Neutral"],
survey_question="How do you feel about the new wellness program?",
api_key="sk-...",
)
Discover categories from open-ended responses
result = catsurvey.extract(
input_data=responses,
api_key="sk-...",
survey_question="What changes would you suggest for the workplace?",
)
print(result["top_categories"])
For finer control, run the two stages yourself: explore() builds a
frequency-ranked inventory of raw category labels, and collapse_themes()
(re-exported from the cat-stack engine) consolidates it into a deduplicated
taxonomy — string-similarity and embedding pre-merge, quality-controlled LLM
merge passes, and an optional count-guided reduction to the top_n most
common categories. extract() chains these two stages for you.
raw_labels = catsurvey.explore( # list[str]: every label, with repeats
input_data=responses,
api_key="sk-...",
survey_question="What changes would you suggest for the workplace?",
)
themes = catsurvey.collapse_themes( # list[str]: consolidated taxonomy
input_data=raw_labels,
api_key="sk-...",
description="What changes would you suggest for the workplace?",
top_n=12,
)
Summarize responses
summaries = catsurvey.summarize(
input_data=responses,
api_key="sk-...",
description="Open-ended feedback from employee satisfaction survey",
)
How It Works
cat-survey is a thin wrapper that:
- Takes your
survey_questionparameter - Injects survey-specific framing: "A respondent was asked: '{survey_question}'."
- Delegates to
cat-stackfor all LLM communication, classification logic, batch processing, and ensemble methods
All cat-stack parameters (multi-model ensemble, batch mode, chain-of-thought, etc.) are passed through via **kwargs.
API
| Function | Description |
|---|---|
classify() |
Classify responses into predefined categories |
extract() |
Discover and normalize categories from responses |
explore() |
Raw category extraction (no deduplication) |
collapse_themes() |
Consolidate an explore() inventory into a deduplicated taxonomy (re-export from cat-stack) |
summarize() |
Summarize responses (pass-through to cat-stack) |
Ecosystem
| Package | Role |
|---|---|
| cat-stack | Domain-agnostic LLM classification engine |
| cat-survey | Survey-specific wrapper (this package) |
| cat-cog | Cognitive assessment scoring (CERAD) |
License
GPL-3.0-or-later
Metadata
Release files for cat-survey 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cat_survey-0.3.0.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cat_survey-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.5 kB
Release files / cat_survey-0.3.0.tar.gz
| Download URL | cat_survey-0.3.0.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78de6aa86814714f70c61b9e7c780623435ce3b96658b9bb4f956261239fcf2c
|
|
BLAKE2b-256 checksum How to use checksums |
441519efe0d259dd585bfb03fa8eef5a6d8b6eaeb3e877c41e780b1075d801b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.14
|
Release files / cat_survey-0.3.0-py3-none-any.whl
| Download URL | cat_survey-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d1cca62c1622b4077430c1c8f85771b3fc347bcaa48481a905fae27c95836b4
|
|
BLAKE2b-256 checksum How to use checksums |
0d2f542d9f91d8e36c7817c6d3d93ded1a09e1c209034ccbea64bb6234de43cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.14
|