Spaces:
Sleeping
Sleeping
elibrowne
commited on
Commit
•
d5c3c24
1
Parent(s):
e525095
Small changes
Browse files- app.py +8 -8
- structure.js +1 -0
app.py
CHANGED
@@ -92,6 +92,7 @@ with gr.Blocks(theme = theme) as user_eval:
|
|
92 |
<h1> Legal Retriever Evaluation Study </h1>
|
93 |
<p> Score the passages based on the question and provided answer choices. Detailed instructions are found <a href="https://docs.google.com/document/d/1ReODJ0hlXz_M3kE2UG1cwSRVoyDLQo88OvG71Gt8lUQ/edit?usp=sharing" target="_blank">here</a>. </p>
|
94 |
""")
|
|
|
95 |
|
96 |
# Passages and user evaluations thereof
|
97 |
with gr.Row(equal_height = False, visible = False) as evals:
|
@@ -128,7 +129,7 @@ with gr.Blocks(theme = theme) as user_eval:
|
|
128 |
desc_3 = gr.Markdown("How effectively does the passage **lead you to the correct answer?**")
|
129 |
eval_3 = gr.Slider(1, 5, step = 0.5, label = "Helpfulness")
|
130 |
btn_p = gr.Button("Next", interactive = False)
|
131 |
-
# Users must enter in a yes/no value before moving on
|
132 |
def sanitize_score(rad):
|
133 |
if rad == None:
|
134 |
return {btn_p: gr.Button(interactive = False)}
|
@@ -162,9 +163,9 @@ with gr.Blocks(theme = theme) as user_eval:
|
|
162 |
scores_p: gr.Column(visible = False),
|
163 |
scores_g: gr.Column(visible = True),
|
164 |
eval_0: gr.Radio(value = None),
|
165 |
-
eval_1: gr.Slider(value =
|
166 |
-
eval_2: gr.Slider(value =
|
167 |
-
eval_3: gr.Slider(value =
|
168 |
}
|
169 |
else:
|
170 |
return {
|
@@ -172,9 +173,9 @@ with gr.Blocks(theme = theme) as user_eval:
|
|
172 |
<h2> Retrieved Passage </h2> <br />
|
173 |
""" + passage_texts[step]),
|
174 |
eval_0: gr.Radio(value = None),
|
175 |
-
eval_1: gr.Slider(value =
|
176 |
-
eval_2: gr.Slider(value =
|
177 |
-
eval_3: gr.Slider(value =
|
178 |
}
|
179 |
|
180 |
def next_g(e_h, e_s):
|
@@ -249,7 +250,6 @@ with gr.Blocks(theme = theme) as user_eval:
|
|
249 |
# Question and answering dynamics
|
250 |
with gr.Row(equal_height = False, visible = False) as question:
|
251 |
with gr.Column():
|
252 |
-
gr.Markdown("---")
|
253 |
gr.Markdown("**Question**")
|
254 |
gr.Markdown(question_text)
|
255 |
a = gr.Button(answers_text[0])
|
|
|
92 |
<h1> Legal Retriever Evaluation Study </h1>
|
93 |
<p> Score the passages based on the question and provided answer choices. Detailed instructions are found <a href="https://docs.google.com/document/d/1ReODJ0hlXz_M3kE2UG1cwSRVoyDLQo88OvG71Gt8lUQ/edit?usp=sharing" target="_blank">here</a>. </p>
|
94 |
""")
|
95 |
+
gr.Markdown("---")
|
96 |
|
97 |
# Passages and user evaluations thereof
|
98 |
with gr.Row(equal_height = False, visible = False) as evals:
|
|
|
129 |
desc_3 = gr.Markdown("How effectively does the passage **lead you to the correct answer?**")
|
130 |
eval_3 = gr.Slider(1, 5, step = 0.5, label = "Helpfulness")
|
131 |
btn_p = gr.Button("Next", interactive = False)
|
132 |
+
# Users must enter in a yes/no value before moving on in the radio area
|
133 |
def sanitize_score(rad):
|
134 |
if rad == None:
|
135 |
return {btn_p: gr.Button(interactive = False)}
|
|
|
163 |
scores_p: gr.Column(visible = False),
|
164 |
scores_g: gr.Column(visible = True),
|
165 |
eval_0: gr.Radio(value = None),
|
166 |
+
eval_1: gr.Slider(value = 3),
|
167 |
+
eval_2: gr.Slider(value = 3),
|
168 |
+
eval_3: gr.Slider(value = 3)
|
169 |
}
|
170 |
else:
|
171 |
return {
|
|
|
173 |
<h2> Retrieved Passage </h2> <br />
|
174 |
""" + passage_texts[step]),
|
175 |
eval_0: gr.Radio(value = None),
|
176 |
+
eval_1: gr.Slider(value = 3),
|
177 |
+
eval_2: gr.Slider(value = 3),
|
178 |
+
eval_3: gr.Slider(value = 3)
|
179 |
}
|
180 |
|
181 |
def next_g(e_h, e_s):
|
|
|
250 |
# Question and answering dynamics
|
251 |
with gr.Row(equal_height = False, visible = False) as question:
|
252 |
with gr.Column():
|
|
|
253 |
gr.Markdown("**Question**")
|
254 |
gr.Markdown(question_text)
|
255 |
a = gr.Button(answers_text[0])
|
structure.js
CHANGED
@@ -17,6 +17,7 @@ var sample_question = {
|
|
17 |
var user_response = {
|
18 |
"user_id": "email@email.com", // track who the respondent is
|
19 |
"question_id": "ID ###", // track which question they are responding to
|
|
|
20 |
"e5_scores": [[1, 2.5, 1.5, 3.5], [0, 1, 4, 1.5]], // [is a law, relevance, quality, helpfulness]
|
21 |
"colbert_scores": [[1, 3, 3, 3], [1, 5, 4, 5]], // same format as above
|
22 |
}
|
|
|
17 |
var user_response = {
|
18 |
"user_id": "email@email.com", // track who the respondent is
|
19 |
"question_id": "ID ###", // track which question they are responding to
|
20 |
+
"user_answer": 0, // A, B, C, or D
|
21 |
"e5_scores": [[1, 2.5, 1.5, 3.5], [0, 1, 4, 1.5]], // [is a law, relevance, quality, helpfulness]
|
22 |
"colbert_scores": [[1, 3, 3, 3], [1, 5, 4, 5]], // same format as above
|
23 |
}
|