Joshnicholas commited on
Commit
69b744b
·
verified ·
1 Parent(s): f194d43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -20,6 +20,11 @@ def merge_tokens(tokens):
20
 
21
  return merged_tokens
22
 
 
 
 
 
 
23
  def named(input):
24
  output = ner(input)
25
  merged_word = merge_tokens(output)
@@ -27,6 +32,6 @@ def named(input):
27
 
28
  a = gr.Interface(fn=named,
29
  inputs=[gr.Textbox(label="Text input", lines= 2)],
30
- outputs=[gr.HighlightedText(label='Text with entities')],
31
- title='Named Entity Recognition', examples=["My name is Andrew, I'm building DeeplearningAI and I live in California", "My name is Poli, I live in Vienna and work at HuggingFace"])
32
  a.launch()
 
20
 
21
  return merged_tokens
22
 
23
+ examples = [
24
+ "Johann Carl Friedrich Gauss was a German mathematician, geodesist, and physicist who made significant contributions to many fields in mathematics and science.",
25
+ 'At Los Alamos, which was isolated for security, Feynman amused himself by investigating the combination locks on the cabinets and desks of physicists. He often found that they left the lock combinations on the factory settings, wrote the combinations down, or used easily guessable combinations like dates.'
26
+ ]
27
+
28
  def named(input):
29
  output = ner(input)
30
  merged_word = merge_tokens(output)
 
32
 
33
  a = gr.Interface(fn=named,
34
  inputs=[gr.Textbox(label="Text input", lines= 2)],
35
+ outputs=[gr.HighlightedText(label='Labelled text')],
36
+ examples=examples)
37
  a.launch()