Skip to content

prolific-oss/AI-Task-Builder-Free-Text-Collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Task-Builder-Free-Text-Collection

Python 3.10+ Status: Beta Purpose: Educational

Ask Prolific participants one open-ended question, then watch their answers (and demographics) stream into a dashboard in real time.

Live dashboard for a "What do you like the most about the world cup?" study: 7 of 7 responses in, summary cards for response count, average age and locations, gender/age/location breakdowns, and a real-time feed of free-text answers each labelled with timestamp, age, gender and country.

Three files, nothing else:

  • config.yaml — the question and study settings (edit this).
  • run.py — launches the study and serves the live dashboard.
  • dashboard.html — the dashboard UI.

Setup (once)

python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env        # then fill in your Prolific token + workspace/project ids

Don't know your workspace/project ids? python run.py --discover lists them.

Run the demo

  1. Edit the question and settings in config.yaml.

  2. Launch and watch:

    python run.py

    This creates the study, asks you to confirm publishing (it spends money — (reward × participants) + platform fee), then opens a live dashboard that refreshes as responses arrive. Ctrl-C to stop the dashboard (the study keeps running on Prolific).

Other commands

Command What it does
python run.py --dry-run Print the exact API payloads. No API calls, no spend.
python run.py --no-publish Create a draft study only (review/publish in the dashboard). No spend.
python run.py --watch STUDY_ID Re-open the live dashboard for a study already running.
python run.py --discover List your workspace / project ids.
python run.py --yes Skip the publish confirmation (publishes immediately).
--port N / --interval N Dashboard port (default 8000) / seconds between refreshes (default 15).

reward is in integer cents per participant; estimated_completion_time is in minutes. Publishing requires a funded workspace wallet on Prolific.

✨ Summary (Claude insights)

If a CLAUDE_API_KEY is set in your .env, the dashboard shows a Summary button. Click it and the collected answers (each labelled with the participant's age, gender and location) are sent to Claude, which returns a written trends analysis for the researcher — recurring themes with approximate counts, notable patterns by demographic, and overall sentiment.

CLAUDE_API_KEY=sk-ant-...   # platform.claude.com → API keys

It uses the anthropic Python SDK with the claude-opus-4-8 model (override with SUMMARY_MODEL in your .env) and sends up to 300 responses per click to keep cost and context in check. No key → the button simply doesn't appear; everything else still works.


Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Important Notice

This project is provided as-is for educational and research purposes only.

  • 🔬 Beta Status: This is experimental code and may contain bugs or incomplete features
  • 📚 Not Maintained: No active development or support is provided
  • 🎓 Educational Use: Intended as a learning resource
  • ⚖️ Use at Your Own Risk: Test thoroughly before using in production environments

About

About This repo will show you how to use Prolific to collect free text within seconds

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors