gliner-test / app.py
goberoi's picture
Create app.py
edbe29c verified
raw
history blame
585 Bytes
import gradio as gr
from main import extract_entities_from_file
def process(file):
results = extract_entities_from_file(file)
if not results:
return "No entities found."
return "\n".join([f"{text} -> {label}" for text, label in results])
iface = gr.Interface(
fn=process,
inputs=gr.File(label="Upload a text file"),
outputs=gr.Textbox(label="Extracted Entities"),
title="GLiNER + SpaCy Entity Extractor",
description="Upload a text file to extract PERSON, ORG, LOCATION, and DISEASE entities."
)
if __name__ == "__main__":
iface.launch()