0-shot-NER / app.py
mvy
update theme
fbd530b
raw
history blame
1.17 kB
import gradio as gr
from ner import NER
examples = [
[
'scientist, university, city',
('Dr. Paul Hammond, a renowned neurologist at'
' Johns Hopkins University, has recently published'
' a paper in the prestigious journal "Nature Neuroscience".'
' His research focuses on a rare genetic mutation, found'
' in less than 0.01% of the population, that appears to'
' prevent the development of Alzheimer\'s disease.'
' Collaborating with researchers at the University'
' of California, San Francisco, the team is now working'
' to understand the mechanism by which this mutation'
' confers its protective effect.\n'
'Funded by the National Institutes of Health, their'
' research could potentially open new avenues for'
' Alzheimer\'s treatment.')
],
]
gradio_app = gr.Interface(
NER.ner,
inputs = ['text', gr.Textbox(placeholder="Enter sentence here..."), gr.Number(value=0.0, label="treshold")],
outputs = [gr.HighlightedText()],
examples=examples,
theme="huggingface",
)
if __name__ == "__main__":
gradio_app.launch()