mborcin commited on
Commit
406fdd9
·
verified ·
1 Parent(s): a7c4714

Make root cause options leaf-only

Browse files
data/tasks_all.json CHANGED
The diff for this file is too large to render. See raw diff
 
data/tasks_annotator_1.json CHANGED
The diff for this file is too large to render. See raw diff
 
data/tasks_annotator_2.json CHANGED
The diff for this file is too large to render. See raw diff
 
data/tasks_annotator_3.json CHANGED
The diff for this file is too large to render. See raw diff
 
label_config.xml CHANGED
@@ -68,6 +68,30 @@
68
  .rca-root-cause div {
69
  break-inside: avoid;
70
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  </Style>
72
 
73
  <View className="rca-shell">
@@ -116,47 +140,7 @@
116
 
117
  <View className="rca-question">
118
  <Header value="Root cause category" />
119
- <Choices name="root_cause_category" toName="case_anchor" choice="single-radio" required="true" allowNested="true" layout="vertical" className="rca-root-cause">
120
- <Choice value="input_error">
121
- <Choice value="Missing fact" />
122
- <Choice value="Incorrect fact" />
123
- <Choice value="Fabricated fact in case record" />
124
- </Choice>
125
- <Choice value="model_error">
126
- <Choice value="Facts">
127
- <Choice value="Fabricated fact in reasoning" />
128
- <Choice value="Fact-weighing error" />
129
- <Choice value="Fact omission in reasoning" />
130
- </Choice>
131
- <Choice value="Issues">
132
- <Choice value="Issue omission" />
133
- <Choice value="Spurious issue" />
134
- <Choice value="Issue misframing" />
135
- <Choice value="Issue misprioritisation" />
136
- </Choice>
137
- <Choice value="Rules">
138
- <Choice value="Wrong rule source" />
139
- <Choice value="Using outdated / overruled rule" />
140
- <Choice value="Rule misinterpretation" />
141
- <Choice value="Rule misapplication" />
142
- <Choice value="Wrong legal test / threshold" />
143
- <Choice value="Missed exception / qualification" />
144
- <Choice value="Limitation / time-bar error" />
145
- <Choice value="Precedent context mismatch" />
146
- <Choice value="Rule interaction error" />
147
- </Choice>
148
- <Choice value="Analysis">
149
- <Choice value="Burden misallocation" />
150
- <Choice value="Neglected rule, fact, or counter-argument" />
151
- <Choice value="Logical fallacy / leap in logic" />
152
- <Choice value="Other reasoning error" />
153
- </Choice>
154
- <Choice value="Conclusion">
155
- <Choice value="Conclusion does not follow from analysis" />
156
- <Choice value="Discretionary original judgment" />
157
- </Choice>
158
- </Choice>
159
- </Choices>
160
  </View>
161
  </View>
162
  </View>
 
68
  .rca-root-cause div {
69
  break-inside: avoid;
70
  }
71
+ .root-option {
72
+ display: grid;
73
+ grid-template-columns: 150px minmax(0, 1fr);
74
+ gap: 8px;
75
+ align-items: start;
76
+ padding: 1px 0;
77
+ }
78
+ .root-option-new-group {
79
+ margin-top: 9px;
80
+ padding-top: 8px;
81
+ border-top: 1px solid #d8dee8;
82
+ }
83
+ .root-group {
84
+ color: #475569;
85
+ font-size: 11px;
86
+ font-weight: 700;
87
+ letter-spacing: 0;
88
+ text-transform: uppercase;
89
+ }
90
+ .root-leaf {
91
+ color: #111827;
92
+ font-size: 14px;
93
+ line-height: 1.25;
94
+ }
95
  </Style>
96
 
97
  <View className="rca-shell">
 
140
 
141
  <View className="rca-question">
142
  <Header value="Root cause category" />
143
+ <Choices name="minor_error_category" toName="case_anchor" choice="single-radio" required="true" layout="vertical" value="$root_cause_options" className="rca-root-cause" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  </View>
145
  </View>
146
  </View>
scripts/prepare_tasks.py CHANGED
@@ -11,42 +11,46 @@ SAMPLE_INDEX = SAMPLE_DIR / "sample_index.csv"
11
  SAMPLED_CASES = SAMPLE_DIR / "sampled_cases"
12
  OUT_DIR = SPACE_ROOT / "data"
13
 
14
- MINOR_ERROR_OPTIONS = [
15
- ("INPUT ERRORS", "Missing fact"),
16
- ("INPUT ERRORS", "Incorrect fact"),
17
- ("INPUT ERRORS", "Fabricated fact in case record"),
18
- ("MODEL ERRORS: FACTS", "Fabricated fact in reasoning"),
19
- ("MODEL ERRORS: FACTS", "Fact-weighing error"),
20
- ("MODEL ERRORS: FACTS", "Fact omission in reasoning"),
21
- ("MODEL ERRORS: ISSUES", "Issue omission"),
22
- ("MODEL ERRORS: ISSUES", "Spurious issue"),
23
- ("MODEL ERRORS: ISSUES", "Issue misframing"),
24
- ("MODEL ERRORS: ISSUES", "Issue misprioritisation"),
25
- ("MODEL ERRORS: RULES", "Wrong rule source"),
26
- ("MODEL ERRORS: RULES", "Using outdated / overruled rule"),
27
- ("MODEL ERRORS: RULES", "Rule misinterpretation"),
28
- ("MODEL ERRORS: RULES", "Rule misapplication"),
29
- ("MODEL ERRORS: RULES", "Wrong legal test / threshold"),
30
- ("MODEL ERRORS: RULES", "Missed exception / qualification"),
31
- ("MODEL ERRORS: RULES", "Limitation / time-bar error"),
32
- ("MODEL ERRORS: RULES", "Precedent context mismatch"),
33
- ("MODEL ERRORS: RULES", "Rule interaction error"),
34
- ("MODEL ERRORS: ANALYSIS", "Burden misallocation"),
35
- ("MODEL ERRORS: ANALYSIS", "Neglected rule, fact, or counter-argument"),
36
- ("MODEL ERRORS: ANALYSIS", "Logical fallacy / leap in logic"),
37
- ("MODEL ERRORS: ANALYSIS", "Other reasoning error"),
38
- ("MODEL ERRORS: CONCLUSION", "Conclusion does not follow from analysis"),
39
- ("MODEL ERRORS: CONCLUSION", "Discretionary original judgment"),
40
  ]
41
 
42
 
43
- def minor_error_options() -> list[dict[str, str]]:
44
  options: list[dict[str, str]] = []
45
- for section, value in MINOR_ERROR_OPTIONS:
 
 
 
 
46
  html = (
47
- "<div class='minor-option'>"
48
- f"<span class='minor-section'>{section}</span>"
49
- f"<span class='minor-value'>{value}</span>"
50
  "</div>"
51
  )
52
  options.append({"value": value, "html": html})
@@ -153,6 +157,7 @@ def build_task(row: dict[str, str]) -> dict[str, Any]:
153
  "case_record": safe_get(case, "extracted.firac.facts", ""),
154
  "generated_judgment": generated_judgment,
155
  "reference_judgment": reference_judgment,
 
156
  },
157
  "meta": {
158
  "sample_id": sample_id,
 
11
  SAMPLED_CASES = SAMPLE_DIR / "sampled_cases"
12
  OUT_DIR = SPACE_ROOT / "data"
13
 
14
+ ROOT_CAUSE_OPTIONS = [
15
+ ("INPUT ERROR", "", "Missing fact"),
16
+ ("INPUT ERROR", "", "Incorrect fact"),
17
+ ("INPUT ERROR", "", "Fabricated fact in case record"),
18
+ ("MODEL ERROR", "Facts", "Fabricated fact in reasoning"),
19
+ ("MODEL ERROR", "Facts", "Fact-weighing error"),
20
+ ("MODEL ERROR", "Facts", "Fact omission in reasoning"),
21
+ ("MODEL ERROR", "Issues", "Issue omission"),
22
+ ("MODEL ERROR", "Issues", "Spurious issue"),
23
+ ("MODEL ERROR", "Issues", "Issue misframing"),
24
+ ("MODEL ERROR", "Issues", "Issue misprioritisation"),
25
+ ("MODEL ERROR", "Rules", "Wrong rule source"),
26
+ ("MODEL ERROR", "Rules", "Using outdated / overruled rule"),
27
+ ("MODEL ERROR", "Rules", "Rule misinterpretation"),
28
+ ("MODEL ERROR", "Rules", "Rule misapplication"),
29
+ ("MODEL ERROR", "Rules", "Wrong legal test / threshold"),
30
+ ("MODEL ERROR", "Rules", "Missed exception / qualification"),
31
+ ("MODEL ERROR", "Rules", "Limitation / time-bar error"),
32
+ ("MODEL ERROR", "Rules", "Precedent context mismatch"),
33
+ ("MODEL ERROR", "Rules", "Rule interaction error"),
34
+ ("MODEL ERROR", "Analysis", "Burden misallocation"),
35
+ ("MODEL ERROR", "Analysis", "Neglected rule, fact, or counter-argument"),
36
+ ("MODEL ERROR", "Analysis", "Logical fallacy / leap in logic"),
37
+ ("MODEL ERROR", "Analysis", "Other reasoning error"),
38
+ ("MODEL ERROR", "Conclusion", "Conclusion does not follow from analysis"),
39
+ ("MODEL ERROR", "Conclusion", "Discretionary original judgment"),
40
  ]
41
 
42
 
43
+ def root_cause_options() -> list[dict[str, str]]:
44
  options: list[dict[str, str]] = []
45
+ previous_group = None
46
+ for major, subgroup, value in ROOT_CAUSE_OPTIONS:
47
+ group = f"{major}: {subgroup}" if subgroup else major
48
+ class_name = "root-option root-option-new-group" if group != previous_group else "root-option"
49
+ previous_group = group
50
  html = (
51
+ f"<div class='{class_name}'>"
52
+ f"<span class='root-group'>{group}</span>"
53
+ f"<span class='root-leaf'>{value}</span>"
54
  "</div>"
55
  )
56
  options.append({"value": value, "html": html})
 
157
  "case_record": safe_get(case, "extracted.firac.facts", ""),
158
  "generated_judgment": generated_judgment,
159
  "reference_judgment": reference_judgment,
160
+ "root_cause_options": root_cause_options(),
161
  },
162
  "meta": {
163
  "sample_id": sample_id,