rjiang12 commited on
Commit
54fd843
·
1 Parent(s): 9156430

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -363,7 +363,7 @@ def startBiasTest(test_sentences_df, gr1, gr2, att1, att2, model_name, progress=
363
  num_atts = 0
364
  for att, score in attrib_by_score.items():
365
  if att in attributes_g2:
366
- per_attrib_bias_HTML_antistereo += att_bloombergViz(att, score, att_freqs[att])
367
  num_atts += 1
368
  if num_atts >= 8:
369
  break
@@ -580,6 +580,8 @@ with gr.Blocks(theme=soft, title="Social Bias Testing in Language Models",
580
  gr.Markdown("### Interpretation")
581
  with gr.Row():
582
  with gr.Column(scale=2):
 
 
583
  lbl_model_bias = gr.Markdown("**Model Bias** - % stereotyped choices (↑ more bias)")
584
  model_bias_html = gr.HTML()
585
  # model_bias_label = gr.Label(num_top_classes=1, label="% stereotyped choices (↑ more bias)",
 
363
  num_atts = 0
364
  for att, score in attrib_by_score.items():
365
  if att in attributes_g2:
366
+ per_attrib_bias_HTML_antistereo += att_bloombergViz(att, 1.0 - score, att_freqs[att])
367
  num_atts += 1
368
  if num_atts >= 8:
369
  break
 
580
  gr.Markdown("### Interpretation")
581
  with gr.Row():
582
  with gr.Column(scale=2):
583
+ gr.Markdown("**Legend**")
584
+ gr.HTML("<div style='height:20px;width:20px;background-color:#555;display:inline-block'></div>: Group 1 attribute <br><div style='height:20px;width:20px;background-color:#999;display:inline-block'></div>: Group 2 attribute")
585
  lbl_model_bias = gr.Markdown("**Model Bias** - % stereotyped choices (↑ more bias)")
586
  model_bias_html = gr.HTML()
587
  # model_bias_label = gr.Label(num_top_classes=1, label="% stereotyped choices (↑ more bias)",