ganeshkamath89 commited on
Commit
1fb95f7
·
verified ·
1 Parent(s): 33d6622

Changing example sentences for NER

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -3,16 +3,15 @@ from transformers import pipeline
3
 
4
  def generate_story(story):
5
  ner = pipeline("ner", model="dbmdz/bert-large-cased-finetuned-conll03-english")
6
- return str(ner("My name is Ganesh Kamath and I work at AMD in Bangalore."))
7
 
8
  demo = gr.Interface (
9
  fn=generate_story,
10
  description="Named Entity Recognition Demo with BERT",
11
  examples=[
12
- ["Adventurer is approached by a mysterious stranger in the tavern for a new quest."],
13
- ["He didn't remember the last time he had to run this fast as he jumped on to the bus."],
14
- ["Fate has it's own plans for the common man, which is why we philosophise on the observationg giving it our own interpretation."],
15
- ["The bear reached the river and spotted a school of fish. His hunger started taking its toll."]
16
  ],
17
  inputs=[gr.Textbox(lines=7, label="Text")],
18
  outputs=[gr.Textbox(lines=7, label="Story NER")]
 
3
 
4
  def generate_story(story):
5
  ner = pipeline("ner", model="dbmdz/bert-large-cased-finetuned-conll03-english")
6
+ return str(ner(story))
7
 
8
  demo = gr.Interface (
9
  fn=generate_story,
10
  description="Named Entity Recognition Demo with BERT",
11
  examples=[
12
+ ["England won the 2019 world cup vs The 2019 world cup happened in England."],
13
+ ["Washington is the capital of the US vs The first president of the US was Washington."],
14
+ ["My name is Ganesh Kamath and I work at AMD in Bangalore."]
 
15
  ],
16
  inputs=[gr.Textbox(lines=7, label="Text")],
17
  outputs=[gr.Textbox(lines=7, label="Story NER")]