Example data
EDSL allows us to generate data or import it from other sources (CSV, PDF, PNG, MP4, DOC, tables, lists, dicts, etc.). Here we construct a dataset for our exercise: a random list of ages between 22 and 85 with some bad values mixed in. Our goal is to identify them:Quick question
With a small dataset, we may be able to design the entire task as a single question where we prompt a model to review all the data at once and flag bad data:
This approach may be feasible for a small dataset that is easily checked. For larger datasets, we may encounter problems with input token limits, a model’s ability to accurately check a large volume of data at once, and responses that are not usefully formatted.
Below we demonstrate some ways of approaching the task in an iterative manner instead.
Constructing a question
We start by creating a question to prompt a model to draft sense check questions for our data. EDSL comes with a variety of question types that we can choose from based on the desired form of the response (multiple choice, free text, etc.). Here we useQuestionList in order to prompt the model to format its response as a list. We use a {{ placeholder }} for content that we will add to the question when we run it (a description of the data and a sample); this allows us to re-use the question with other contexts as desired:
Adding context to the question
Next we createScenario objects representing the content that we want to add to the question when we run it. Here we create a single scenario for our example data:
Running the question
We administer the question to a model by adding the scenarios and calling therun method. This generates a formatted dataset of Results that we can access with built-in methods for analysis. Here we inspect the answer:
Conducting the task
Next we want a model to answer each sense check question about each piece of data in the dataset. This can be done by using the sense check questions as scenarios of a new question explaining the task. We can useQuestionYesNo to easily filter the responses:
ScenarioList objects to create all the combinations of values to add to the question (learn more about constructing scenarios from different data sources):
Same as with a single scenario, we add all the scenarios to the question at once when we run it:
