Skip to main content

Create and analyze LLM-based surveys

Project description

Expected Parrot Domain-Specific Language

edsl.png

The Expected Parrot Domain-Specific Language (EDSL) package lets you conduct computational social science and market research with AI. Use it to design surveys and experiments, simulate responses with large language models, and perform data labeling and other research tasks. Results are formatted as specified datasets and come with built-in methods for analyzing, visualizing, and sharing.

๐Ÿ”— Links

๐Ÿ’ก Contributions, feature requests & bugs

Interested in contributing? Want us to add a new feature? Found a bug for us to squash? Please send us an email at info@expectedparrot.com or message us at our Discord channel.

๐Ÿ’ป Requirements

  • EDSL is compatible with Python 3.9 - 3.12.
  • API keys for large language models that you want to use, stored in a .env file. See instructions on storing API keys.

๐ŸŒŽ Hello, World!

A quick example:

# Import a question type
from edsl.questions import QuestionMultipleChoice

# Construct a question using the question type template
q = QuestionMultipleChoice(
    question_name="example_question",
    question_text="How do you feel today?",
    question_options=["Bad", "OK", "Good"]
)

# Run it with the default language model
results = q.run()

# Inspect the results in a dataset
results.select("example_question").print()

Output:

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ answer            โ”ƒ
โ”ƒ .example_question โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Good              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edsl-0.1.28.tar.gz (231.2 kB view hashes)

Uploaded Source

Built Distribution

edsl-0.1.28-py3-none-any.whl (307.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page