import json import gradio as gr def ner(text): api = gr.Interface.load("d4data/biomedical-ner-all", src="models") result = api(text) return result EXAMPLE_TEXTS = [] with open("examples.json", "r") as f: example_json = json.load(f) EXAMPLE_TEXTS = [x["text"] for x in example_json] interface = gr.Interface( ner, inputs=gr.Textbox(label="Input", value=""), outputs=["json"], examples=EXAMPLE_TEXTS, ) interface.launch()