Sina1138 commited on
Commit Β·
7a14afe
1
Parent(s): 5a18658
Update pre-processed tab to have a consistent design as interactive tab.
Browse files- interface/Demo.py +79 -62
interface/Demo.py
CHANGED
|
@@ -1043,61 +1043,61 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1043 |
q25, q75 = float(_np.percentile(arr, 25)), float(_np.percentile(arr, 75))
|
| 1044 |
_kl_iqr = q75 - q25
|
| 1045 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1046 |
for i in range(10):
|
| 1047 |
if i < number_of_displayed_reviews:
|
| 1048 |
-
|
| 1049 |
-
# OR old structure: just a dict of sentences
|
| 1050 |
-
review_data = current_review[i]
|
| 1051 |
-
rebuttal_html = ""
|
| 1052 |
-
|
| 1053 |
-
if isinstance(review_data, dict) and "sentences" in review_data:
|
| 1054 |
-
review_item = list(review_data["sentences"].items())
|
| 1055 |
-
rebuttal = review_data.get("rebuttal", "")
|
| 1056 |
-
if rebuttal and rebuttal.strip():
|
| 1057 |
-
# Format rebuttal as collapsible HTML card
|
| 1058 |
-
rebuttal_html = (
|
| 1059 |
-
'<details style="margin-top:8px;margin-bottom:12px;border-radius:6px;overflow:hidden;border:1px solid #fde68a;background:#fffef5;">'
|
| 1060 |
-
'<summary style="padding:10px 14px;cursor:pointer;font-size:0.75em;color:#92400e;'
|
| 1061 |
-
'font-weight:600;list-style:none;display:flex;align-items:center;gap:6px;">'
|
| 1062 |
-
'<span style="transition:transform 0.2s;">βΆ</span> Author Response</summary>'
|
| 1063 |
-
'<div style="padding:10px 14px;">'
|
| 1064 |
-
f'<div style="white-space:pre-wrap;color:#1f2937;font-size:0.85em;line-height:1.5;">{rebuttal}</div>'
|
| 1065 |
-
'</div></details>'
|
| 1066 |
-
)
|
| 1067 |
-
else:
|
| 1068 |
-
# Backward compatibility with old format
|
| 1069 |
-
review_item = list(review_data.items())
|
| 1070 |
|
| 1071 |
if show_polarity:
|
| 1072 |
highlighted = []
|
| 1073 |
for sentence, metadata in review_item:
|
| 1074 |
polarity = metadata.get("polarity", None)
|
| 1075 |
if polarity == 2:
|
| 1076 |
-
label = "β"
|
| 1077 |
elif polarity == 0:
|
| 1078 |
-
label = "β"
|
| 1079 |
else:
|
| 1080 |
-
label = None
|
| 1081 |
highlighted.append((sentence, label))
|
| 1082 |
elif show_consensuality:
|
| 1083 |
-
highlighted = []
|
| 1084 |
-
import math
|
| 1085 |
-
for sentence, metadata in review_item:
|
| 1086 |
-
raw = metadata.get("consensuality", 0.0)
|
| 1087 |
-
# Robust normalization: median-centered, IQR-scaled, clipped to [-1, 1]
|
| 1088 |
-
if _kl_iqr > 0:
|
| 1089 |
-
score = max(-1.0, min(1.0, (raw - _kl_median) / (_kl_iqr * 2)))
|
| 1090 |
-
else:
|
| 1091 |
-
score = 0.0
|
| 1092 |
-
# Display-time filtering: noise sentences and near-zero scores get no color
|
| 1093 |
-
if is_noise_sentence(sentence) or abs(score) < HIGHLIGHT_THRESHOLD:
|
| 1094 |
-
highlighted.append((sentence, None))
|
| 1095 |
-
else:
|
| 1096 |
-
consensuality_dict[sentence] = score
|
| 1097 |
-
# Asymmetric amplification for display
|
| 1098 |
-
display_score = math.copysign(abs(score) ** (AGREEMENT_AMP_UNIQUE if score > 0 else AGREEMENT_AMP_COMMON), score)
|
| 1099 |
-
highlighted.append((sentence, display_score))
|
| 1100 |
-
|
| 1101 |
elif show_topic:
|
| 1102 |
highlighted = []
|
| 1103 |
for sentence, metadata in review_item:
|
|
@@ -1112,15 +1112,30 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1112 |
for sentence, _ in review_item
|
| 1113 |
]
|
| 1114 |
|
|
|
|
| 1115 |
review_updates.append(
|
| 1116 |
gr.update(
|
| 1117 |
-
visible=
|
| 1118 |
value=highlighted,
|
| 1119 |
color_map=color_map,
|
| 1120 |
show_legend=legend,
|
| 1121 |
key=f"updated_{score_type}_{i}"
|
| 1122 |
)
|
| 1123 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1124 |
rebuttal_updates.append(gr.update(visible=bool(rebuttal_html), value=rebuttal_html))
|
| 1125 |
else:
|
| 1126 |
review_updates.append(
|
|
@@ -1132,32 +1147,23 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1132 |
key=f"updated_{score_type}_{i}"
|
| 1133 |
)
|
| 1134 |
)
|
|
|
|
| 1135 |
rebuttal_updates.append(gr.update(visible=False, value=""))
|
| 1136 |
|
| 1137 |
# General rebuttal display (currently unused in new format, kept for backward compat)
|
| 1138 |
general_rebuttal_update = gr.update(visible=False, value="")
|
| 1139 |
|
| 1140 |
-
# Set most
|
|
|
|
|
|
|
| 1141 |
if show_consensuality and consensuality_dict:
|
| 1142 |
scores = pd.Series(consensuality_dict)
|
| 1143 |
-
|
| 1144 |
-
most_common = scores.sort_values(ascending=True).head(3).index.tolist()
|
| 1145 |
-
|
| 1146 |
-
# Build per-review sentence lists for attribution
|
| 1147 |
-
review_sentence_lists = []
|
| 1148 |
-
for review_data in current_review:
|
| 1149 |
-
if isinstance(review_data, dict) and "sentences" in review_data:
|
| 1150 |
-
review_sentence_lists.append(list(review_data["sentences"].keys()))
|
| 1151 |
-
elif isinstance(review_data, dict):
|
| 1152 |
-
review_sentence_lists.append(list(review_data.keys()))
|
| 1153 |
-
else:
|
| 1154 |
-
review_sentence_lists.append([])
|
| 1155 |
|
| 1156 |
most_common_html = format_summary_cards(most_common, consensuality_dict, review_sentence_lists, "common")
|
| 1157 |
-
most_unique_html = format_summary_cards(most_unique, consensuality_dict, review_sentence_lists, "unique")
|
| 1158 |
|
| 1159 |
most_common_visibility = gr.update(visible=True, value=most_common_html)
|
| 1160 |
-
most_unique_visibility = gr.update(visible=
|
| 1161 |
else:
|
| 1162 |
most_common_visibility = gr.update(visible=False, value="")
|
| 1163 |
most_unique_visibility = gr.update(visible=False, value="")
|
|
@@ -1183,6 +1189,7 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1183 |
return (
|
| 1184 |
new_review_id,
|
| 1185 |
*review_updates,
|
|
|
|
| 1186 |
most_common_visibility,
|
| 1187 |
most_unique_visibility,
|
| 1188 |
topic_color_map_visibility,
|
|
@@ -1195,7 +1202,7 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1195 |
|
| 1196 |
# Precompute the initial outputs so something is shown on load.
|
| 1197 |
init_display = update_review_display(initial_state, score_type="Original")
|
| 1198 |
-
# init_display returns: (review_id, review1..10, most_common, most_unique, topic_box, prep_rebuttal1..10, prep_general_rebuttal, state)
|
| 1199 |
|
| 1200 |
with gr.Row():
|
| 1201 |
|
|
@@ -1211,7 +1218,7 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1211 |
year = gr.Dropdown(choices=years, label="Select Year", interactive=True, value=initial_year)
|
| 1212 |
score_type = gr.Radio(
|
| 1213 |
choices=["No Highlighting", "Polarity", "Topic", "Agreement"],
|
| 1214 |
-
label="
|
| 1215 |
value="No Highlighting",
|
| 1216 |
interactive=True
|
| 1217 |
)
|
|
@@ -1239,24 +1246,34 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1239 |
|
| 1240 |
gr.Markdown("### π Reviews", elem_classes=["review-section-header"])
|
| 1241 |
review1 = gr.HighlightedText(show_legend=False, label="π Review 1", visible=number_of_displayed_reviews >= 1, key="initial_review1")
|
|
|
|
| 1242 |
prep_rebuttal1 = gr.HTML(visible=False, value="")
|
| 1243 |
review2 = gr.HighlightedText(show_legend=False, label="π Review 2", visible=number_of_displayed_reviews >= 2, key="initial_review2")
|
|
|
|
| 1244 |
prep_rebuttal2 = gr.HTML(visible=False, value="")
|
| 1245 |
review3 = gr.HighlightedText(show_legend=False, label="π Review 3", visible=number_of_displayed_reviews >= 3, key="initial_review3")
|
|
|
|
| 1246 |
prep_rebuttal3 = gr.HTML(visible=False, value="")
|
| 1247 |
review4 = gr.HighlightedText(show_legend=False, label="π Review 4", visible=number_of_displayed_reviews >= 4, key="initial_review4")
|
|
|
|
| 1248 |
prep_rebuttal4 = gr.HTML(visible=False, value="")
|
| 1249 |
review5 = gr.HighlightedText(show_legend=False, label="π Review 5", visible=number_of_displayed_reviews >= 5, key="initial_review5")
|
|
|
|
| 1250 |
prep_rebuttal5 = gr.HTML(visible=False, value="")
|
| 1251 |
review6 = gr.HighlightedText(show_legend=False, label="π Review 6", visible=number_of_displayed_reviews >= 6, key="initial_review6")
|
|
|
|
| 1252 |
prep_rebuttal6 = gr.HTML(visible=False, value="")
|
| 1253 |
review7 = gr.HighlightedText(show_legend=False, label="π Review 7", visible=number_of_displayed_reviews >= 7, key="initial_review7")
|
|
|
|
| 1254 |
prep_rebuttal7 = gr.HTML(visible=False, value="")
|
| 1255 |
review8 = gr.HighlightedText(show_legend=False, label="π Review 8", visible=number_of_displayed_reviews >= 8, key="initial_review8")
|
|
|
|
| 1256 |
prep_rebuttal8 = gr.HTML(visible=False, value="")
|
| 1257 |
review9 = gr.HighlightedText(show_legend=False, label="π Review 9", visible=number_of_displayed_reviews >= 9, key="initial_review9")
|
|
|
|
| 1258 |
prep_rebuttal9 = gr.HTML(visible=False, value="")
|
| 1259 |
review10 = gr.HighlightedText(show_legend=False, label="π Review 10", visible=number_of_displayed_reviews >= 10, key="initial_review10")
|
|
|
|
| 1260 |
prep_rebuttal10 = gr.HTML(visible=False, value="")
|
| 1261 |
|
| 1262 |
# General rebuttal section (for rebuttals not tied to specific reviews)
|
|
@@ -1283,7 +1300,7 @@ with gr.Blocks(title="ReView", css=CUSTOM_CSS) as demo:
|
|
| 1283 |
return update_review_display(state, score_type)
|
| 1284 |
|
| 1285 |
# Hook up the callbacks with the session state.
|
| 1286 |
-
_review_outputs = [review_id, review1, review2, review3, review4, review5, review6, review7, review8, review9, review10, most_common_sentences, most_unique_sentences, topic_text_box, prep_rebuttal1, prep_rebuttal2, prep_rebuttal3, prep_rebuttal4, prep_rebuttal5, prep_rebuttal6, prep_rebuttal7, prep_rebuttal8, prep_rebuttal9, prep_rebuttal10, prep_general_rebuttal, state]
|
| 1287 |
year.change(fn=year_change, inputs=[year, state, score_type], outputs=_review_outputs)
|
| 1288 |
score_type.change(fn=update_review_display, inputs=[state, score_type], outputs=_review_outputs)
|
| 1289 |
next_button.click(fn=next_review, inputs=[state, score_type], outputs=_review_outputs)
|
|
|
|
| 1043 |
q25, q75 = float(_np.percentile(arr, 25)), float(_np.percentile(arr, 75))
|
| 1044 |
_kl_iqr = q75 - q25
|
| 1045 |
|
| 1046 |
+
# Build per-review sentence lists (needed for agreement HTML + summary cards)
|
| 1047 |
+
review_sentence_lists = []
|
| 1048 |
+
review_items_cache = [] # Cache (review_item, rebuttal_html) per review
|
| 1049 |
+
for idx in range(number_of_displayed_reviews):
|
| 1050 |
+
review_data = current_review[idx]
|
| 1051 |
+
rebuttal_html = ""
|
| 1052 |
+
if isinstance(review_data, dict) and "sentences" in review_data:
|
| 1053 |
+
review_item = list(review_data["sentences"].items())
|
| 1054 |
+
rebuttal = review_data.get("rebuttal", "")
|
| 1055 |
+
if rebuttal and rebuttal.strip():
|
| 1056 |
+
rebuttal_html = (
|
| 1057 |
+
'<details style="margin-top:8px;margin-bottom:12px;border-radius:6px;overflow:hidden;border:1px solid #fde68a;background:#fffef5;">'
|
| 1058 |
+
'<summary style="padding:10px 14px;cursor:pointer;font-size:0.75em;color:#92400e;'
|
| 1059 |
+
'font-weight:600;list-style:none;display:flex;align-items:center;gap:6px;">'
|
| 1060 |
+
'<span style="transition:transform 0.2s;">βΆ</span> Author Response</summary>'
|
| 1061 |
+
'<div style="padding:10px 14px;">'
|
| 1062 |
+
f'<div style="white-space:pre-wrap;color:#1f2937;font-size:0.85em;line-height:1.5;">{rebuttal}</div>'
|
| 1063 |
+
'</div></details>'
|
| 1064 |
+
)
|
| 1065 |
+
else:
|
| 1066 |
+
review_item = list(review_data.items())
|
| 1067 |
+
review_sentence_lists.append([s for s, _ in review_item])
|
| 1068 |
+
review_items_cache.append((review_item, rebuttal_html))
|
| 1069 |
+
|
| 1070 |
+
# For agreement mode, build uniqueness dict upfront for render_agreement_html
|
| 1071 |
+
if show_consensuality:
|
| 1072 |
+
for idx in range(number_of_displayed_reviews):
|
| 1073 |
+
review_item, _ = review_items_cache[idx]
|
| 1074 |
+
for sentence, metadata in review_item:
|
| 1075 |
+
raw = metadata.get("consensuality", 0.0)
|
| 1076 |
+
if _kl_iqr > 0:
|
| 1077 |
+
score = max(-1.0, min(1.0, (raw - _kl_median) / (_kl_iqr * 2)))
|
| 1078 |
+
else:
|
| 1079 |
+
score = 0.0
|
| 1080 |
+
if not is_noise_sentence(sentence) and abs(score) >= HIGHLIGHT_THRESHOLD:
|
| 1081 |
+
consensuality_dict[sentence] = score
|
| 1082 |
+
|
| 1083 |
+
agreement_updates = []
|
| 1084 |
for i in range(10):
|
| 1085 |
if i < number_of_displayed_reviews:
|
| 1086 |
+
review_item, rebuttal_html = review_items_cache[i]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1087 |
|
| 1088 |
if show_polarity:
|
| 1089 |
highlighted = []
|
| 1090 |
for sentence, metadata in review_item:
|
| 1091 |
polarity = metadata.get("polarity", None)
|
| 1092 |
if polarity == 2:
|
| 1093 |
+
label = "β"
|
| 1094 |
elif polarity == 0:
|
| 1095 |
+
label = "β"
|
| 1096 |
else:
|
| 1097 |
+
label = None
|
| 1098 |
highlighted.append((sentence, label))
|
| 1099 |
elif show_consensuality:
|
| 1100 |
+
highlighted = [(sentence, None) for sentence, _ in review_item]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1101 |
elif show_topic:
|
| 1102 |
highlighted = []
|
| 1103 |
for sentence, metadata in review_item:
|
|
|
|
| 1112 |
for sentence, _ in review_item
|
| 1113 |
]
|
| 1114 |
|
| 1115 |
+
# HighlightedText: visible for all modes except agreement
|
| 1116 |
review_updates.append(
|
| 1117 |
gr.update(
|
| 1118 |
+
visible=not show_consensuality,
|
| 1119 |
value=highlighted,
|
| 1120 |
color_map=color_map,
|
| 1121 |
show_legend=legend,
|
| 1122 |
key=f"updated_{score_type}_{i}"
|
| 1123 |
)
|
| 1124 |
)
|
| 1125 |
+
|
| 1126 |
+
# Agreement HTML: visible only in agreement mode
|
| 1127 |
+
if show_consensuality:
|
| 1128 |
+
sentences_for_review = [s for s, _ in review_item]
|
| 1129 |
+
agreement_html = render_agreement_html(
|
| 1130 |
+
sentences_for_review, consensuality_dict,
|
| 1131 |
+
listener={}, speaker={},
|
| 1132 |
+
num_reviews=number_of_displayed_reviews,
|
| 1133 |
+
label=f"Agreement in Review {i + 1}",
|
| 1134 |
+
)
|
| 1135 |
+
agreement_updates.append(gr.update(visible=True, value=agreement_html))
|
| 1136 |
+
else:
|
| 1137 |
+
agreement_updates.append(gr.update(visible=False, value=""))
|
| 1138 |
+
|
| 1139 |
rebuttal_updates.append(gr.update(visible=bool(rebuttal_html), value=rebuttal_html))
|
| 1140 |
else:
|
| 1141 |
review_updates.append(
|
|
|
|
| 1147 |
key=f"updated_{score_type}_{i}"
|
| 1148 |
)
|
| 1149 |
)
|
| 1150 |
+
agreement_updates.append(gr.update(visible=False, value=""))
|
| 1151 |
rebuttal_updates.append(gr.update(visible=False, value=""))
|
| 1152 |
|
| 1153 |
# General rebuttal display (currently unused in new format, kept for backward compat)
|
| 1154 |
general_rebuttal_update = gr.update(visible=False, value="")
|
| 1155 |
|
| 1156 |
+
# Set most common opinions (as HTML cards with context)
|
| 1157 |
+
# Most Unique/Divergent is hidden at top level β consistent with
|
| 1158 |
+
# the interactive tab which embeds divergent cards per-review.
|
| 1159 |
if show_consensuality and consensuality_dict:
|
| 1160 |
scores = pd.Series(consensuality_dict)
|
| 1161 |
+
most_common = scores.sort_values(ascending=True).head(5).index.tolist()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1162 |
|
| 1163 |
most_common_html = format_summary_cards(most_common, consensuality_dict, review_sentence_lists, "common")
|
|
|
|
| 1164 |
|
| 1165 |
most_common_visibility = gr.update(visible=True, value=most_common_html)
|
| 1166 |
+
most_unique_visibility = gr.update(visible=False, value="")
|
| 1167 |
else:
|
| 1168 |
most_common_visibility = gr.update(visible=False, value="")
|
| 1169 |
most_unique_visibility = gr.update(visible=False, value="")
|
|
|
|
| 1189 |
return (
|
| 1190 |
new_review_id,
|
| 1191 |
*review_updates,
|
| 1192 |
+
*agreement_updates, # 10 agreement HTML sections
|
| 1193 |
most_common_visibility,
|
| 1194 |
most_unique_visibility,
|
| 1195 |
topic_color_map_visibility,
|
|
|
|
| 1202 |
|
| 1203 |
# Precompute the initial outputs so something is shown on load.
|
| 1204 |
init_display = update_review_display(initial_state, score_type="Original")
|
| 1205 |
+
# init_display returns: (review_id, review1..10, agreement1..10, most_common, most_unique, topic_box, prep_rebuttal1..10, prep_general_rebuttal, state)
|
| 1206 |
|
| 1207 |
with gr.Row():
|
| 1208 |
|
|
|
|
| 1218 |
year = gr.Dropdown(choices=years, label="Select Year", interactive=True, value=initial_year)
|
| 1219 |
score_type = gr.Radio(
|
| 1220 |
choices=["No Highlighting", "Polarity", "Topic", "Agreement"],
|
| 1221 |
+
label="Display Mode:",
|
| 1222 |
value="No Highlighting",
|
| 1223 |
interactive=True
|
| 1224 |
)
|
|
|
|
| 1246 |
|
| 1247 |
gr.Markdown("### π Reviews", elem_classes=["review-section-header"])
|
| 1248 |
review1 = gr.HighlightedText(show_legend=False, label="π Review 1", visible=number_of_displayed_reviews >= 1, key="initial_review1")
|
| 1249 |
+
prep_agreement1 = gr.HTML(visible=False, value="")
|
| 1250 |
prep_rebuttal1 = gr.HTML(visible=False, value="")
|
| 1251 |
review2 = gr.HighlightedText(show_legend=False, label="π Review 2", visible=number_of_displayed_reviews >= 2, key="initial_review2")
|
| 1252 |
+
prep_agreement2 = gr.HTML(visible=False, value="")
|
| 1253 |
prep_rebuttal2 = gr.HTML(visible=False, value="")
|
| 1254 |
review3 = gr.HighlightedText(show_legend=False, label="π Review 3", visible=number_of_displayed_reviews >= 3, key="initial_review3")
|
| 1255 |
+
prep_agreement3 = gr.HTML(visible=False, value="")
|
| 1256 |
prep_rebuttal3 = gr.HTML(visible=False, value="")
|
| 1257 |
review4 = gr.HighlightedText(show_legend=False, label="π Review 4", visible=number_of_displayed_reviews >= 4, key="initial_review4")
|
| 1258 |
+
prep_agreement4 = gr.HTML(visible=False, value="")
|
| 1259 |
prep_rebuttal4 = gr.HTML(visible=False, value="")
|
| 1260 |
review5 = gr.HighlightedText(show_legend=False, label="π Review 5", visible=number_of_displayed_reviews >= 5, key="initial_review5")
|
| 1261 |
+
prep_agreement5 = gr.HTML(visible=False, value="")
|
| 1262 |
prep_rebuttal5 = gr.HTML(visible=False, value="")
|
| 1263 |
review6 = gr.HighlightedText(show_legend=False, label="π Review 6", visible=number_of_displayed_reviews >= 6, key="initial_review6")
|
| 1264 |
+
prep_agreement6 = gr.HTML(visible=False, value="")
|
| 1265 |
prep_rebuttal6 = gr.HTML(visible=False, value="")
|
| 1266 |
review7 = gr.HighlightedText(show_legend=False, label="π Review 7", visible=number_of_displayed_reviews >= 7, key="initial_review7")
|
| 1267 |
+
prep_agreement7 = gr.HTML(visible=False, value="")
|
| 1268 |
prep_rebuttal7 = gr.HTML(visible=False, value="")
|
| 1269 |
review8 = gr.HighlightedText(show_legend=False, label="π Review 8", visible=number_of_displayed_reviews >= 8, key="initial_review8")
|
| 1270 |
+
prep_agreement8 = gr.HTML(visible=False, value="")
|
| 1271 |
prep_rebuttal8 = gr.HTML(visible=False, value="")
|
| 1272 |
review9 = gr.HighlightedText(show_legend=False, label="π Review 9", visible=number_of_displayed_reviews >= 9, key="initial_review9")
|
| 1273 |
+
prep_agreement9 = gr.HTML(visible=False, value="")
|
| 1274 |
prep_rebuttal9 = gr.HTML(visible=False, value="")
|
| 1275 |
review10 = gr.HighlightedText(show_legend=False, label="π Review 10", visible=number_of_displayed_reviews >= 10, key="initial_review10")
|
| 1276 |
+
prep_agreement10 = gr.HTML(visible=False, value="")
|
| 1277 |
prep_rebuttal10 = gr.HTML(visible=False, value="")
|
| 1278 |
|
| 1279 |
# General rebuttal section (for rebuttals not tied to specific reviews)
|
|
|
|
| 1300 |
return update_review_display(state, score_type)
|
| 1301 |
|
| 1302 |
# Hook up the callbacks with the session state.
|
| 1303 |
+
_review_outputs = [review_id, review1, review2, review3, review4, review5, review6, review7, review8, review9, review10, prep_agreement1, prep_agreement2, prep_agreement3, prep_agreement4, prep_agreement5, prep_agreement6, prep_agreement7, prep_agreement8, prep_agreement9, prep_agreement10, most_common_sentences, most_unique_sentences, topic_text_box, prep_rebuttal1, prep_rebuttal2, prep_rebuttal3, prep_rebuttal4, prep_rebuttal5, prep_rebuttal6, prep_rebuttal7, prep_rebuttal8, prep_rebuttal9, prep_rebuttal10, prep_general_rebuttal, state]
|
| 1304 |
year.change(fn=year_change, inputs=[year, state, score_type], outputs=_review_outputs)
|
| 1305 |
score_type.change(fn=update_review_display, inputs=[state, score_type], outputs=_review_outputs)
|
| 1306 |
next_button.click(fn=next_review, inputs=[state, score_type], outputs=_review_outputs)
|