File size: 1,437 Bytes
63230e3 |
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 |
import gradio as gr
import pandas as pd
# Load dataset
df = pd.read_csv("human_like_security_reasoning.csv")
def get_scenario(scenario_id):
row = df[df["scenario_id"] == scenario_id].iloc[0]
return (
row["situation"],
row["context"],
row["human_thought_process"],
row["possible_mistake"],
row["correct_decision"],
row["risk_level"],
row["explanation"]
)
with gr.Blocks(title="Human-Like Security Reasoning Explorer") as demo:
gr.Markdown("""
# 🔐 Human-Like Security Reasoning Explorer
Explore cybersecurity, system, and network scenarios
with **human-style thinking and decision making**.
""")
scenario_selector = gr.Dropdown(
choices=df["scenario_id"].tolist(),
label="Select Scenario ID"
)
situation = gr.Textbox(label="Situation")
context = gr.Textbox(label="Context")
thought = gr.Textbox(label="Human Thought Process")
mistake = gr.Textbox(label="Possible Mistake")
decision = gr.Textbox(label="Correct Decision")
risk = gr.Textbox(label="Risk Level")
explanation = gr.Textbox(label="Explanation")
scenario_selector.change(
get_scenario,
inputs=scenario_selector,
outputs=[
situation,
context,
thought,
mistake,
decision,
risk,
explanation
]
)
demo.launch() |