Spaces:
Runtime error
Runtime error
Anon Anon commited on
Commit ·
5386bb9
1
Parent(s): 570c959
Update text for improved readability
Browse files
app.py
CHANGED
|
@@ -213,7 +213,7 @@ with demo:
|
|
| 213 |
gr.Markdown(
|
| 214 |
"#### LLMs are pretty good at reporting their uncertainty. We just need to ask the right way.")
|
| 215 |
gr.Markdown("Using our uncertainty metric informed by applying causal inference techniques in \
|
| 216 |
-
[
|
| 217 |
we are able to identify likely spurious correlations and exploit them in \
|
| 218 |
the scenario of gender underspecified tasks. (Note that introspecting softmax probabilities alone is insufficient, as in the sentences \
|
| 219 |
below, LLMs may report a softmax prob of ~0.9 despite the task being underspecified.)")
|
|
@@ -221,13 +221,16 @@ with demo:
|
|
| 221 |
eight syntactically similar sentences. However semantically, \
|
| 222 |
only two of the sentences are well-specified while the rest remain underspecified.")
|
| 223 |
gr.Markdown("If a model can reliably tell us when it is uncertain about its predictions, one can replace only those uncertain predictions with\
|
| 224 |
-
an appropriate heuristic.")
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
with gr.Row():
|
| 227 |
model_name = gr.Radio(
|
| 228 |
MODEL_NAMES,
|
| 229 |
type="value",
|
| 230 |
-
label="Pick a preloaded BERT-like model for uncertainty evaluation (note:
|
| 231 |
)
|
| 232 |
own_model_name = gr.Textbox(
|
| 233 |
label=f"...Or, if you selected an '{OWN_MODEL_NAME}' model, put any Hugging Face pipeline model name \
|
|
@@ -236,19 +239,19 @@ with demo:
|
|
| 236 |
|
| 237 |
with gr.Row():
|
| 238 |
occ_box = gr.Radio(
|
| 239 |
-
occs+[PICK_YOUR_OWN_LABEL], label=f"Pick an Occupation type from the Winogender Schemas evaluation set, or select '{PICK_YOUR_OWN_LABEL}'\
|
| 240 |
(it need not be about an occupation).")
|
| 241 |
|
| 242 |
with gr.Row():
|
| 243 |
alt_input_texts = gr.Textbox(
|
| 244 |
lines=2,
|
| 245 |
-
label=f"...
|
| 246 |
to include a single MASK-ed out pronoun. \
|
| 247 |
If unsure on the required format, click an occupation above instead, to see some example input texts for this round."
|
| 248 |
)
|
| 249 |
|
| 250 |
with gr.Row():
|
| 251 |
-
get_text_btn = gr.Button("
|
| 252 |
|
| 253 |
get_text_btn.click(
|
| 254 |
fn=display_input_texts,
|
|
@@ -259,7 +262,7 @@ with demo:
|
|
| 259 |
)
|
| 260 |
|
| 261 |
with gr.Row():
|
| 262 |
-
uncertain_btn = gr.Button("
|
| 263 |
gr.Markdown(
|
| 264 |
"If there is an * by a sentence number, then at least one top prediction for that sentence was non-gendered.")
|
| 265 |
|
|
|
|
| 213 |
gr.Markdown(
|
| 214 |
"#### LLMs are pretty good at reporting their uncertainty. We just need to ask the right way.")
|
| 215 |
gr.Markdown("Using our uncertainty metric informed by applying causal inference techniques in \
|
| 216 |
+
[our ICLR paper under review](https://openreview.net/pdf?id=25VgHaPz0l4), \
|
| 217 |
we are able to identify likely spurious correlations and exploit them in \
|
| 218 |
the scenario of gender underspecified tasks. (Note that introspecting softmax probabilities alone is insufficient, as in the sentences \
|
| 219 |
below, LLMs may report a softmax prob of ~0.9 despite the task being underspecified.)")
|
|
|
|
| 221 |
eight syntactically similar sentences. However semantically, \
|
| 222 |
only two of the sentences are well-specified while the rest remain underspecified.")
|
| 223 |
gr.Markdown("If a model can reliably tell us when it is uncertain about its predictions, one can replace only those uncertain predictions with\
|
| 224 |
+
an appropriate heuristic or information retrieval process.")
|
| 225 |
+
|
| 226 |
+
gr.Markdown("#### TL;DR")
|
| 227 |
+
gr.Markdown("Follow steps below to test out one of the pre-loaded options. Once you get the hang of it, you can load a new model and/or provide your own input texts.")
|
| 228 |
|
| 229 |
with gr.Row():
|
| 230 |
model_name = gr.Radio(
|
| 231 |
MODEL_NAMES,
|
| 232 |
type="value",
|
| 233 |
+
label="1) Pick a preloaded BERT-like model for uncertainty evaluation (note: RoBERTa-large performance is best)...",
|
| 234 |
)
|
| 235 |
own_model_name = gr.Textbox(
|
| 236 |
label=f"...Or, if you selected an '{OWN_MODEL_NAME}' model, put any Hugging Face pipeline model name \
|
|
|
|
| 239 |
|
| 240 |
with gr.Row():
|
| 241 |
occ_box = gr.Radio(
|
| 242 |
+
occs+[PICK_YOUR_OWN_LABEL], label=f"2) Pick an Occupation type from the Winogender Schemas evaluation set, or select '{PICK_YOUR_OWN_LABEL}'\
|
| 243 |
(it need not be about an occupation).")
|
| 244 |
|
| 245 |
with gr.Row():
|
| 246 |
alt_input_texts = gr.Textbox(
|
| 247 |
lines=2,
|
| 248 |
+
label=f"...Or, if you selected '{PICK_YOUR_OWN_LABEL}' above, add your own texts new-line delimited sentences here. Be sure\
|
| 249 |
to include a single MASK-ed out pronoun. \
|
| 250 |
If unsure on the required format, click an occupation above instead, to see some example input texts for this round."
|
| 251 |
)
|
| 252 |
|
| 253 |
with gr.Row():
|
| 254 |
+
get_text_btn = gr.Button("3) Load input texts")
|
| 255 |
|
| 256 |
get_text_btn.click(
|
| 257 |
fn=display_input_texts,
|
|
|
|
| 262 |
)
|
| 263 |
|
| 264 |
with gr.Row():
|
| 265 |
+
uncertain_btn = gr.Button("4) Get uncertainty results!")
|
| 266 |
gr.Markdown(
|
| 267 |
"If there is an * by a sentence number, then at least one top prediction for that sentence was non-gendered.")
|
| 268 |
|