Spaces:
Runtime error
Runtime error
Commit
·
339a5a9
1
Parent(s):
9ec2e86
refactor: rename category to domain
Browse files
app.py
CHANGED
|
@@ -35,25 +35,25 @@ def calculate_overall_percentage():
|
|
| 35 |
|
| 36 |
|
| 37 |
# Load data
|
| 38 |
-
df = pd.read_csv("
|
| 39 |
-
grouped = df.groupby(["
|
| 40 |
|
| 41 |
# Create an interface per group of indicators
|
| 42 |
interfaces = []
|
| 43 |
tab_names = []
|
| 44 |
-
for (
|
| 45 |
questions = group["Definition"].tolist()
|
| 46 |
inputs = [gr.Checkbox(label=question) for question in questions]
|
| 47 |
-
output = gr.Textbox(label="
|
| 48 |
iface = gr.Interface(
|
| 49 |
fn=calculate_percentage,
|
| 50 |
inputs=inputs,
|
| 51 |
outputs=output,
|
| 52 |
-
title=f"{
|
| 53 |
allow_flagging="never",
|
| 54 |
)
|
| 55 |
interfaces.append(iface)
|
| 56 |
-
tab_names.append(
|
| 57 |
|
| 58 |
# Add overall percentage button
|
| 59 |
overall_button = gr.Interface(
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
# Load data
|
| 38 |
+
df = pd.read_csv("fmti-indicators.csv")
|
| 39 |
+
grouped = df.groupby(["Domain", "Subdomain"])
|
| 40 |
|
| 41 |
# Create an interface per group of indicators
|
| 42 |
interfaces = []
|
| 43 |
tab_names = []
|
| 44 |
+
for (domain, subdomain), group in grouped:
|
| 45 |
questions = group["Definition"].tolist()
|
| 46 |
inputs = [gr.Checkbox(label=question) for question in questions]
|
| 47 |
+
output = gr.Textbox(label="Subdomain Percentage")
|
| 48 |
iface = gr.Interface(
|
| 49 |
fn=calculate_percentage,
|
| 50 |
inputs=inputs,
|
| 51 |
outputs=output,
|
| 52 |
+
title=f"{domain} - {subdomain}",
|
| 53 |
allow_flagging="never",
|
| 54 |
)
|
| 55 |
interfaces.append(iface)
|
| 56 |
+
tab_names.append(subdomain)
|
| 57 |
|
| 58 |
# Add overall percentage button
|
| 59 |
overall_button = gr.Interface(
|