MuntasirHossain
commited on
Commit
•
c0fcdfe
1
Parent(s):
e3bab5f
Update app.py
Browse files
app.py
CHANGED
@@ -9,19 +9,18 @@ nlp = spacy.load("en_core_web_trf")
|
|
9 |
def ner(text):
|
10 |
doc = nlp(text)
|
11 |
html = displacy.render(doc, style="ent", page=True)
|
12 |
-
# html = displacy.render(doc, style="ent", page=True, manual=True, minify=True)
|
13 |
html = (
|
14 |
-
"
|
15 |
+ html
|
16 |
-
+ "
|
17 |
)
|
18 |
return html
|
19 |
|
20 |
title = "Named Entity Recognition"
|
21 |
|
22 |
demo = gr.Interface(
|
23 |
-
ner,
|
24 |
-
gr.Textbox(placeholder="Enter sentence here..."),
|
25 |
outputs="html",
|
26 |
title=title,
|
27 |
examples=["In February 2006, Musk led Tesla's Series B venture capital funding round of $13 million, which added Valor Equity Partners to the funding team. \
|
|
|
9 |
def ner(text):
|
10 |
doc = nlp(text)
|
11 |
html = displacy.render(doc, style="ent", page=True)
|
|
|
12 |
html = (
|
13 |
+
""
|
14 |
+ html
|
15 |
+
+ ""
|
16 |
)
|
17 |
return html
|
18 |
|
19 |
title = "Named Entity Recognition"
|
20 |
|
21 |
demo = gr.Interface(
|
22 |
+
fn=ner,
|
23 |
+
inputs=gr.Textbox(placeholder="Enter sentence here..."),
|
24 |
outputs="html",
|
25 |
title=title,
|
26 |
examples=["In February 2006, Musk led Tesla's Series B venture capital funding round of $13 million, which added Valor Equity Partners to the funding team. \
|