Skip to main content
This tutorial takes you from a single feedback question to classifying several messages and exporting the answers. You will see how questions, scenarios, models, and results fit together. It begins with a fixed local test response, then shows how to choose a language model for the same workflow.

Install EDSL

Follow Installation for supported Python versions and environment setup:
Run the code in a notebook or Python script. The CLI Guide provides an equivalent command line workflow.

Construct a survey and run a local test

The example asks for a service improvement and uses a test model configured to return a fixed answer. You can run it immediately without an account or model credentials.
The displayed table contains one answer.feedback value: “Make the export button easier to find.” The Survey defines the questions, the Model supplies an execution configuration, by() creates a job, and run() returns a Results object. select() extracts a Dataset with the requested answer column. This fixed response tests the workflow; it is not a research observation.

Vary inputs with scenarios

Replace the single free-text task with a classification question applied to several feedback records. Construction alone makes no model calls:
job contains three interviews, one for each feedback record. variant_survey demonstrates the alternative of constructing multiple distinct questions within one survey; see Scenarios for when to use each approach.

Log in to Expected Parrot

To use Expected Parrot’s model access from a notebook, run:
Follow the sign-in link in the cell output. EDSL retrieves and stores your API key automatically. For login options or direct provider access, see Model access and API keys.

Choose a language model

Inspect the current model catalog with Model.available() or ep models --text. Select a model appropriate for the task and review costs. Calling Model() without a name selects your configured default model. You can inspect its name and parameters:
To choose a specific model instead, pass its name to Model() and its provider’s service name as service_name. Replace both placeholders below with the corresponding identifiers from the catalog:
Model names and availability change, so use the current catalog values. You can also pass parameters supported by your chosen model as keyword arguments; see Language models for configuration details. Once you have chosen either the default or a specific model, apply it to the job and run the survey. This makes model calls and may incur usage costs:
Expected output is three completed interview records, each with an answer.sentiment value from the allowed options. Actual labels depend on the model and inputs; inspect errors and completion counts before analysis.

Inspect and export responses

Keep the record identifier beside each answer so you can join classifications to source data or human labels. See Results and Dataset for filtering, comparison, and export.

Extend the study