Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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='
|
31 |
-
|
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()
|