File size: 1,725 Bytes
da9c0a0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
import gradio as gr
def run_evaluation(dataset_id, methodology):
return f'Running evaluation for {dataset_id} with {methodology}'
if methodology == 'A':
run_a(dataset_id)
elif methodology == 'B':
run_b(dataset_id)
elif methodology == 'C':
run_c(dataset_id)
demo = gr.Blocks(theme=gr.themes.Soft())
with demo:
gr.Markdown("# BiasAware: Dataset Bias Detection")
with gr.Row():
with gr.Column(scale=1):
gr.Markdown("Select a dataset to analyze")
dataset_id = gr.Text(label="Dataset")
gr.Examples(
examples=["imdb", "amazon_reviews_multi", "tweet_eval"],
fn=run_evaluation,
inputs=[dataset_id]
)
methodology = gr.Dropdown(["Term Identity Diversity Analysis", "Textual Gender Label Evaluation", "GenBit"], label="Methodology")
button = gr.Button("Run Evaluation")
with gr.Column(scale=4):
gr.Markdown("### Results")
with gr.Box():
methodology_title = gr.Markdown("### Identity Term Sampling")
methodology_description = gr.Markdown("lorem ipsum")
methodology_test_description = gr.Markdown("lorem ipsum")
outputs = gr.Markdown()
gr.Error("No results to display")
methodology.change(
fn=lambda x: (f'### {x}', "lorem ipseum", "lorem ipsum"),
inputs=[methodology],
outputs=[methodology_title, methodology_description, methodology_test_description]
)
button.click(
fn=run_evaluation,
inputs=[dataset_id, methodology],
outputs=[outputs]
)
demo.launch() |