qualia_core_db/inference/conditioning_eval/
corpus.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub enum SplitType {
5 Train,
6 Dev,
7 HeldOutTest,
8}
9
10#[derive(Debug, Clone)]
11pub struct TaskItem {
12 pub task_id: String,
13 pub split: SplitType,
14 pub prompt: String,
15 pub expected_outcome: String,
16 pub domain: String,
17}
18
19#[derive(Debug, Clone)]
20pub struct TaskManifest {
21 pub manifest_id: String,
22 pub version: u32,
23 pub tasks: Vec<TaskItem>,
24}
25
26impl TaskManifest {
27 pub fn new(manifest_id: impl Into<String>, version: u32) -> Self {
29 Self {
30 manifest_id: manifest_id.into(),
31 version,
32 tasks: Vec::new(),
33 }
34 }
35
36 pub fn add_task(&mut self, task: TaskItem) {
38 self.tasks.push(task);
39 }
40
41 pub fn held_out_tasks(&self) -> impl Iterator<Item = &TaskItem> {
43 self.tasks
44 .iter()
45 .filter(|t| t.split == SplitType::HeldOutTest)
46 }
47}