elibrowne commited on
Commit
d460b8a
·
1 Parent(s): 7c3fd9a

Collapsible?

Browse files
Files changed (1) hide show
  1. app.py +22 -10
app.py CHANGED
@@ -55,17 +55,27 @@ passage_texts = ["The IDEA also requires states receiving federal funds to educa
55
  "Although state classifications based on alienage are generally suspect, a state may reserve a government position for citizens if it is related to self-governance, involves policymaking, or requires exercise of important discretionary power over citizens. In these cases, only a rationality test is used. A public school teacher at the primary and secondary school level performs an important governmental function (e.g., he influences students' attitudes about government, the political process, citizenship, etc.), and therefore the exclusion of aliens is rationally related to the state's interest in furthering educational goals. [Ambach v. Norwick (1979)]",
56
  "Passage 9",
57
  "Passage 10"]
58
- generation_4 = "Here is a generation at 4 passages."
59
- generation_6 = "Here is a generation at 6 passages."
60
- generation_10 = "Here is a generation at 10 passages."
61
- gold_passage = "GOLD PASSAGE"
62
  step = 0
63
 
 
 
 
 
 
 
 
 
 
 
 
64
  # BLOCKS: main user interface
65
 
66
  user_id = "NO_ID"
67
 
68
- with gr.Blocks() as user_eval:
69
  # Title text introducing study
70
  gr.Markdown("""
71
  # Legal Retriever Evaluation Study
@@ -108,8 +118,10 @@ with gr.Blocks() as user_eval:
108
  btn_p = gr.Button("Next")
109
 
110
  with gr.Column(scale = 1, visible = False) as scores_g:
111
- satisfied = gr.Markdown("How satisfied are you by this answer?")
112
- eval_satisfied = gr.Slider(1, 5, step = 0.5, label = "Would someone answering the question find value in these responses?")
 
 
113
  btn_g = gr.Button("Next")
114
 
115
  def next_p(eval_1, eval_2, eval_3):
@@ -135,14 +147,14 @@ with gr.Blocks() as user_eval:
135
  """ + passage_texts[step])
136
  }
137
 
138
- def next_g(eval_satisfied):
139
- print(eval_satisfied)
140
  return {
141
  selection: gr.Markdown("next summary")
142
  }
143
 
144
  btn_p.click(fn = next_p, inputs = [eval_1, eval_2, eval_3], outputs = [selection, scores_p, scores_g])
145
- btn_g.click(fn = next_g, inputs = [eval_satisfied], outputs = [selection])
146
 
147
  # Question and answering dynamics
148
  with gr.Row(equal_height = False, visible = False) as question:
 
55
  "Although state classifications based on alienage are generally suspect, a state may reserve a government position for citizens if it is related to self-governance, involves policymaking, or requires exercise of important discretionary power over citizens. In these cases, only a rationality test is used. A public school teacher at the primary and secondary school level performs an important governmental function (e.g., he influences students' attitudes about government, the political process, citizenship, etc.), and therefore the exclusion of aliens is rationally related to the state's interest in furthering educational goals. [Ambach v. Norwick (1979)]",
56
  "Passage 9",
57
  "Passage 10"]
58
+ generation = "The strongest argument for the constitutionality of the act is that it represents a reasonable balance between achieving school desegregation and respecting local control. It limits federal court orders to prevent overly burdensome transportation requirements for students, aiming to achieve desegregation while minimizing disruption for families. The act is seen as a legitimate exercise of Congress's authority to shape the implementation of federal laws, acknowledging local concerns and practicalities without entirely undermining the desegregation goals."
59
+ gold_passage = "Unlike its original jurisdiction, the appellate jurisdiction of the Supreme Court is subject to “exceptions and regulations” prescribed by Congress, and the jurisdiction of the inferior federal courts is subject to congressional prescription. Additionally, Congress has power to regulate modes and practices of proceeding on the part of the inferior federal courts. Whether there are limitations to the exercise of these congressional powers, and what the limitations may be, are matters that have vexed scholarly and judicial interpretation over the years, inasmuch as congressional displeasure with judicial decisions has sometimes led to successful efforts to “curb” the courts and more frequently to proposed but unsuccessful curbs."
60
+ gold_passage_generation = "The strongest argument for the constitutionality of the Congressional act is that Congress has the constitutional authority to regulate federal court jurisdiction and procedures. This includes setting limits on judicial orders. By restricting desegregation plans to only require transportation to the nearest or next nearest school, Congress is exercising its power to define and control how federal courts address such issues, ensuring judicial actions align with legislative priorities and practical concerns."
 
61
  step = 0
62
 
63
+ sample_dict = {
64
+ "question": question_text,
65
+ "answers": answers_text,
66
+ "correct_answer_index": answer_id,
67
+ "top10": passage_texts,
68
+ "generation": generation,
69
+ "top10_contains_gold_passage": False,
70
+ "gold_passage": gold_passage,
71
+ "gold_passage_generation": gold_passage_generation
72
+ }
73
+
74
  # BLOCKS: main user interface
75
 
76
  user_id = "NO_ID"
77
 
78
+ with gr.Blocks(theme=gr.themes.Soft()) as user_eval:
79
  # Title text introducing study
80
  gr.Markdown("""
81
  # Legal Retriever Evaluation Study
 
118
  btn_p = gr.Button("Next")
119
 
120
  with gr.Column(scale = 1, visible = False) as scores_g:
121
+ helps = gr.Markdown("Does this information **help answer** the question?")
122
+ eval_helps = gr.Slider(1, 5, step = 0.5, label = "Helpfulness")
123
+ satisfied = gr.Markdown("How **satisfied** are you by this answer?")
124
+ eval_satisfied = gr.Slider(1, 5, step = 0.5, label = "User Satisfaction")
125
  btn_g = gr.Button("Next")
126
 
127
  def next_p(eval_1, eval_2, eval_3):
 
147
  """ + passage_texts[step])
148
  }
149
 
150
+ def next_g(eval_helps, eval_satisfied):
151
+ print(eval_helps + eval_satisfied)
152
  return {
153
  selection: gr.Markdown("next summary")
154
  }
155
 
156
  btn_p.click(fn = next_p, inputs = [eval_1, eval_2, eval_3], outputs = [selection, scores_p, scores_g])
157
+ btn_g.click(fn = next_g, inputs = [eval_helps, eval_satisfied], outputs = [selection])
158
 
159
  # Question and answering dynamics
160
  with gr.Row(equal_height = False, visible = False) as question: