Skip to content

Commit 09dc851

Browse files
authored
Merge pull request #1972 from expectedparrot/docs_0523
Added note about reasoning models and example nb
2 parents a9f6999 + f8c358b commit 09dc851

File tree

8 files changed

+3702
-5
lines changed

8 files changed

+3702
-5
lines changed

docs/credits.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ To purchase credits, navigate to the `Credits <https://www.expectedparrot.com/ho
4343

4444
*Note:*
4545
Payments are processed by Stripe.
46-
You may be charged payment processing fees when purchasing credits.
4746

4847

4948
Using credits

docs/humanize.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.. _humanize:
2+
3+
Humanize
4+
========
5+
6+
EDSL comes with built-in methods for generating web-based versions of your surveys and collecting and analyzing human responses.
7+
8+
*Note:* This page provides information about EDSL code methods for launching surveys, gathering human responses, and analyzing results from your workspace.
9+
For more information about building surveys interactively, see the :ref:`survey_builder` page.
10+
11+
12+
How it works
13+
------------
14+
15+
1. Create a `Survey` (see the :ref:`surveys` section for details and examples).
16+
2. Use the `run` method to launch your survey with AI :ref:`agents` and :ref:`language_models`.
17+
3. Use the `humanize` method to generate a web-based version of your survey, with a link that can be shared with human respondents and another link for the admin page at your Coop account where you can access responses interactively. *Note:* You may want to modify your LLM-based survey to add or change questions specific to human respondents before calling the `humanize` method, e.g., to add screening questions for aligning human respondents and AI agent personas.
18+
4. Share the web survey link with human respondents.
19+
5. Use the `Coop().get_project_human_responses` method to collect the responses in a `Results` object.
20+
6. Analyze the results together with your LLM results.
21+
22+
23+
Example
24+
-------
25+
26+
Code and results for the example below are also accessible at this downloadable `notebook at Coop <https://www.expectedparrot.com/content/RobinHorton/human-results-example-notebook>`_.
27+
28+
.. code-block:: python
29+
30+
# Import modules from EDSL
31+
from edsl import (
32+
QuestionYesNo,
33+
QuestionNumerical,
34+
QuestionLinearScale,
35+
Survey,
36+
Agent,
37+
Model,
38+
Coop
39+
)
40+
41+
# Create a survey with different question types
42+
q1 = QuestionYesNo(
43+
question_name="drive",
44+
question_text="Do you drive?"
45+
)
46+
47+
q2 = QuestionNumerical(
48+
question_name="count",
49+
question_text="How many vehicles do you currently own or lease?",
50+
)
51+
52+
q3 = QuestionLinearScale(
53+
question_name="enjoy",
54+
question_text="On a scale from 1 to 10, how much do you enjoy driving?",
55+
question_options=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
56+
option_labels={1: "Hate it", 10: "Love it"},
57+
)
58+
59+
# Create a survey with the questions
60+
survey = Survey(questions=[q1, q2, q3])
61+
62+
# Create an AI agent to respond to the survey
63+
agent = Agent(
64+
traits={
65+
"persona": "You are a middle-aged mom working on a software startup.",
66+
"location": "Massachusetts",
67+
}
68+
)
69+
70+
# Select a language model to generate the responses
71+
model = Model("gemini-1.5-pro", service_name="google")
72+
73+
# Run the survey with the AI agent and model
74+
results = survey.by(agent).by(model).run()
75+
76+
# Generate a web-based version of the survey for human respondents
77+
web_survey_info = survey.humanize()
78+
79+
# Create a Coop instance
80+
coop = Coop()
81+
82+
# Get human responses from Coop
83+
human_responses = coop.get_project_human_responses(web_survey_info["uuid"])
84+
85+
# Combine results (you can add Results objects for the same survey)
86+
combined_results = results + human_results
87+
88+
89+
*We are continually adding features for launching hybrid LLM and human surveys, so check back for updates!*
90+
*If you are interested in testing new features please reach out at anytime for credits and access.*
91+

docs/index.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Expected Parrot: Tools for AI-Powered Research
55

66
Expected Parrot delivers powerful tools for conducting research with human and artificial intelligences.
77

8-
This page provides documentation for **Expected Parrot Domain-Specific Language (EDSL)**, a Python package for performing research with AI agents and language models,
9-
and **Coop**, a platform for creating, storing and sharing AI-based research projects.
8+
This page provides documentation for **Expected Parrot Domain-Specific Language (EDSL)**, an open-source Python package for performing research with AI agents and language models,
9+
and **Coop**, a platform for creating, storing and sharing AI research projects.
1010

1111
* EDSL is available to download from `PyPI <https://pypi.org/project/edsl/>`_ (run `pip install edsl`). The source code is available at `GitHub <https://github.com/expectedparrot/edsl>`_.
12-
* `Create an account <https://www.expectedparrot.com/login>`_ to post and share content, run surveys and store results at the Expected Parrot survey. Learn more about `how it works <https://docs.expectedparrot.com/en/latest/coop.html>`_ and start `exploring <https://www.expectedparrot.com/content/explore>`_.
12+
* `Create an account <https://www.expectedparrot.com/login>`_ to post and share content, run surveys with LLMs and humans, and store results at the Expected Parrot server. Learn more about `how it works <https://docs.expectedparrot.com/en/latest/coop.html>`_ and start `exploring <https://www.expectedparrot.com/content/explore>`_.
1313

1414

1515
Key features
@@ -94,6 +94,10 @@ Please see the links in the steps below for more details:
9494
Read the :ref:`starter_tutorial` and `download a notebook <https://www.expectedparrot.com/content/179b3a78-2505-4568-acd9-c09d18953288>`_ to create a survey and run it.
9595
See examples for many use cases and `tips <https://docs.expectedparrot.com/en/latest/checklist.html>`_ on using EDSL effectively in the documentation.
9696

97+
5. **Validate with real respondents.**
98+
99+
You can run surveys with real respondents using the Coop platform or at your workspace.
100+
Learn about methods for generating web-based surveys and collecting responses in the :ref:`survey_builder` and :ref:`humanize` sections.
97101

98102
Join our `Discord channel <https://discord.com/invite/mxAYkjfy9m>`_ to ask questions and chat with other users!
99103

@@ -142,6 +146,7 @@ Coop
142146
It is fully integrated with EDSL and provides access to special features for working with AI agents and language models, free storage and collaboration tools, including:
143147

144148
- :ref:`survey_builder`: A user-friendly no-code interface for creating surveys and gathering responses from humans and AI agents.
149+
- :ref:`humanize`: Generate web-based surveys and collect responses from human respondents.
145150
- :ref:`remote_inference`: Access all available language models and run surveys at the Expected Parrot server.
146151
- :ref:`remote_caching`: Automatically store results and API calls at the Expected Parrot server.
147152
- :ref:`notebooks` & :ref:`colab_notebooks`: Easily post and share `.ipynb` and `.py` files to the Coop and access with Colab.
@@ -173,6 +178,7 @@ Examples of special methods and use cases for EDSL, including:
173178
- Conducting agent conversations
174179
- Converting surveys into EDSL
175180
- Cognitive testing
181+
- Validating LLM answers with humans
176182
- Research methods
177183

178184

@@ -227,6 +233,7 @@ Links
227233
:hidden:
228234

229235
results
236+
humanize
230237
dataset
231238
data
232239
exceptions
@@ -285,6 +292,8 @@ Links
285292
:caption: Notebooks
286293
:hidden:
287294

295+
notebooks/data_labeling_validation_example.ipynb
296+
notebooks/reasoning_model_example.ipynb
288297
notebooks/next_token_probs.ipynb
289298
notebooks/summarizing_transcripts.ipynb
290299
notebooks/analyze_evaluations.ipynb

docs/language_models.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ Output:
5656
* - xai
5757

5858

59+
*Note*: We recently added support for OpenAI reasoning models. See an example notebook for usage `here <https://www.expectedparrot.com/content/RobinHorton/reasoning-model-example>`_.
60+
Use `service_name = "openai_v2"` when using these models. The `Results` that are generated with reasoning models include additional fields for reasoning summaries.
61+
5962
.. Available models
6063
.. ----------------
6164

0 commit comments

Comments
 (0)