add app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,30 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
2 |
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import pandas as pd
|
4 |
+
from gradio_huggingfacehub_search import HuggingfaceHubSearch
|
5 |
|
|
|
|
|
6 |
|
7 |
+
def analyze_dataset(dataset: str) -> pd.DataFrame:
|
8 |
+
yield f"Presidio scan results for {dataset}:", pd.DataFrame({"type": [], "text": [], "row_idx": [], "column_name": []})
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=analyze_dataset,
|
12 |
+
inputs=[
|
13 |
+
HuggingfaceHubSearch(
|
14 |
+
label="Hub Dataset ID",
|
15 |
+
placeholder="Search for dataset id on Huggingface",
|
16 |
+
search_type="dataset",
|
17 |
+
),
|
18 |
+
],
|
19 |
+
outputs=[
|
20 |
+
gr.Markdown(),
|
21 |
+
gr.DataFrame(),
|
22 |
+
],
|
23 |
+
title="Scan datasets using Presidio",
|
24 |
+
description="The space takes an HF dataset name as an input, and returns the list of entities detected by Presidio in the first samples.",
|
25 |
+
)
|
26 |
+
|
27 |
+
with gr.Blocks() as demo:
|
28 |
+
iface.render()
|
29 |
+
|
30 |
demo.launch()
|