Skip to content

getbyxpo/edsl

 
 

Repository files navigation

Expected Parrot Domain-Specific Language (EDSL)

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

edsl.png

Getting started

Requirements

  • EDSL is compatible with Python 3.9 - 3.12.
  • API keys for language models. You can use your own keys or an Expected Parrot key that provides access to all available models. See instructions on managing keys and model pricing and performance information.

Coop

An integrated platform for running experiments, sharing workflows and launching hybrid human/AI surveys.

Community

Contact

Hello, World!

A quick example:

# Import a question type
from edsl import QuestionMultipleChoice, Agent, Model

# Construct a question
q = QuestionMultipleChoice(
  question_name = "research",
  question_text = "What is the worst part of conducting research?",
  question_options = [
    "Securing funding",
    "Finding reliable data sources",
    "Publishing in reputable journals",
    "Balancing research with other responsibilities",
    "Dealing with peer review feedback"
  ]
)

# Create an agent
a = Agent(traits = {"persona":"You are a researcher."})

# Select a model
m = Model("gemini-1.5-flash")

# Administer the question
results = q.by(a).by(m).run()

# Inspect the results
results.select("research")

Output:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ answer.research                                ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Balancing research with other responsibilities │
└──────────────────━━━━━━━━━━━━━━━━━━━━━━━───────┘

About

Design, conduct and analyze results of AI-powered surveys and experiments. Simulate social science and market research with large numbers of AI agents and LLMs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 97.7%
  • Jinja 0.7%
  • HTML 0.6%
  • Makefile 0.4%
  • Batchfile 0.3%
  • CSS 0.2%
  • Other 0.1%