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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cat_survey-0.3.0.tar.gz.
File metadata
- Download URL: cat_survey-0.3.0.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78de6aa86814714f70c61b9e7c780623435ce3b96658b9bb4f956261239fcf2c
|
|
| MD5 |
ec7c0e6ac6c6b58c2c4f8352e362efe8
|
|
| BLAKE2b-256 |
441519efe0d259dd585bfb03fa8eef5a6d8b6eaeb3e877c41e780b1075d801b5
|
File details
Details for the file cat_survey-0.3.0-py3-none-any.whl.
File metadata
- Download URL: cat_survey-0.3.0-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d1cca62c1622b4077430c1c8f85771b3fc347bcaa48481a905fae27c95836b4
|
|
| MD5 |
d2007e1d49eb30a6ca7db87075e4f312
|
|
| BLAKE2b-256 |
0d2f542d9f91d8e36c7817c6d3d93ded1a09e1c209034ccbea64bb6234de43cb
|