import gradio as gr import requests import pandas as pd from gradio_huggingfacehub_search import HuggingfaceHubSearch def analyze_dataset(dataset: str) -> pd.DataFrame: yield f"Presidio scan results for {dataset}:", pd.DataFrame({"type": [], "text": [], "row_idx": [], "column_name": []}) iface = gr.Interface( fn=analyze_dataset, inputs=[ HuggingfaceHubSearch( label="Hub Dataset ID", placeholder="Search for dataset id on Huggingface", search_type="dataset", ), ], outputs=[ gr.Markdown(), gr.DataFrame(), ], title="Scan datasets using Presidio", description="The space takes an HF dataset name as an input, and returns the list of entities detected by Presidio in the first samples.", ) with gr.Blocks() as demo: iface.render() demo.launch()