File size: 701 Bytes
a970736
e91e0ec
5a65659
c805802
7ee34df
1fb95f7
5a65659
 
c805802
bffb940
83c780e
1fb95f7
 
 
83c780e
021f551
 
1cfb225
5a65659
619e8b5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from transformers import pipeline

def generate_story(story):
    ner = pipeline("ner", model="dbmdz/bert-large-cased-finetuned-conll03-english")
    return str(ner(story))

demo = gr.Interface (
    fn=generate_story,
    description="Named Entity Recognition Demo with BERT",
    examples=[
        ["England won the 2019 world cup vs The 2019 world cup happened in England."],
        ["Washington is the capital of the US vs The first president of the US was Washington."],
        ["My name is Ganesh Kamath and I work at AMD in Bangalore."]
    ],
    inputs=[gr.Textbox(lines=7, label="Text")],
    outputs=[gr.Textbox(lines=7, label="Story NER")]
)

demo.launch(share=True)