Skip to main content

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:

  1. Takes your survey_question parameter
  2. Injects survey-specific framing: "A respondent was asked: '{survey_question}'."
  3. Delegates to cat-stack for 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

cat_survey-0.3.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cat_survey-0.3.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

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

Hashes for cat_survey-0.3.0.tar.gz
Algorithm Hash digest
SHA256 78de6aa86814714f70c61b9e7c780623435ce3b96658b9bb4f956261239fcf2c
MD5 ec7c0e6ac6c6b58c2c4f8352e362efe8
BLAKE2b-256 441519efe0d259dd585bfb03fa8eef5a6d8b6eaeb3e877c41e780b1075d801b5

See more details on using hashes here.

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

Hashes for cat_survey-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d1cca62c1622b4077430c1c8f85771b3fc347bcaa48481a905fae27c95836b4
MD5 d2007e1d49eb30a6ca7db87075e4f312
BLAKE2b-256 0d2f542d9f91d8e36c7817c6d3d93ded1a09e1c209034ccbea64bb6234de43cb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

1 file

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page