Spaces:
Sleeping
Sleeping
vertical UI + add examples
Browse files
app.py
CHANGED
@@ -53,24 +53,24 @@ def analyze_dataset(dataset: str) -> pd.DataFrame:
|
|
53 |
rows, scanned_columns=scanned_columns, columns_descriptions=columns_descriptions
|
54 |
):
|
55 |
presidio_entities.append(presidio_entity)
|
56 |
-
yield f"βοΈ Scanning {dataset} [{rows.next_idx}
|
57 |
-
yield f"β
Scanning {dataset} [{rows.next_idx}
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
inputs=[
|
62 |
HuggingfaceHubSearch(
|
63 |
label="Hub Dataset ID",
|
64 |
placeholder="Search for dataset id on Huggingface",
|
65 |
search_type="dataset",
|
66 |
),
|
67 |
-
]
|
68 |
-
|
|
|
69 |
gr.Markdown(),
|
70 |
gr.DataFrame(),
|
71 |
-
]
|
72 |
-
|
73 |
-
|
74 |
-
)
|
75 |
|
76 |
demo.launch()
|
|
|
53 |
rows, scanned_columns=scanned_columns, columns_descriptions=columns_descriptions
|
54 |
):
|
55 |
presidio_entities.append(presidio_entity)
|
56 |
+
yield f"βοΈ Scanning {dataset} [{rows.next_idx}/{num_rows} rows]:", pd.DataFrame(presidio_entities)
|
57 |
+
yield f"β
Scanning {dataset} [{rows.next_idx}/{num_rows}rows]:", pd.DataFrame(presidio_entities)
|
58 |
|
59 |
+
with gr.Block(title="Scan datasets using Presidio") as demo:
|
60 |
+
gr.Markdown("The space takes an HF dataset name as an input, and returns the list of entities detected by Presidio in the first samples.")
|
61 |
+
inputs = [
|
62 |
HuggingfaceHubSearch(
|
63 |
label="Hub Dataset ID",
|
64 |
placeholder="Search for dataset id on Huggingface",
|
65 |
search_type="dataset",
|
66 |
),
|
67 |
+
]
|
68 |
+
button = gr.Button("Run Presidio Scan")
|
69 |
+
outputs = [
|
70 |
gr.Markdown(),
|
71 |
gr.DataFrame(),
|
72 |
+
]
|
73 |
+
button.click(analyze_dataset, inputs, outputs)
|
74 |
+
gr.Examples(["microsoft/orca-math-word-problems-200k", "yahma/alpaca-cleaned", "Anthropic/persuasion", ""])
|
|
|
75 |
|
76 |
demo.launch()
|