wannaphong
commited on
Commit
•
454eaa3
1
Parent(s):
eb75c2d
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def corefer(text):
|
|
16 |
title=None
|
17 |
dic_ents = {"text":text,"ents":[],"title":title}
|
18 |
_tag=[str(i) for i in list(range(len(clusters)))]
|
19 |
-
for i,tag in enumerate(
|
20 |
for s,e in tag:
|
21 |
dic_ents["ents"].append({"start": s, "end": e, "label": _tag[i]})
|
22 |
colors={i:"#"+''.join([random.choice('0123456789ABCDEF') for j in range(6)]) for i in _tag} # thank https://stackoverflow.com/a/50218895
|
@@ -25,5 +25,5 @@ def corefer(text):
|
|
25 |
|
26 |
iface = gr.Interface(fn=corefer,
|
27 |
inputs=gr.Textbox(label="Enter Text To Corefer with FastCoref", lines=2, value=default),
|
28 |
-
outputs="html")
|
29 |
iface.launch()
|
|
|
16 |
title=None
|
17 |
dic_ents = {"text":text,"ents":[],"title":title}
|
18 |
_tag=[str(i) for i in list(range(len(clusters)))]
|
19 |
+
for i,tag in enumerate(clusters):
|
20 |
for s,e in tag:
|
21 |
dic_ents["ents"].append({"start": s, "end": e, "label": _tag[i]})
|
22 |
colors={i:"#"+''.join([random.choice('0123456789ABCDEF') for j in range(6)]) for i in _tag} # thank https://stackoverflow.com/a/50218895
|
|
|
25 |
|
26 |
iface = gr.Interface(fn=corefer,
|
27 |
inputs=gr.Textbox(label="Enter Text To Corefer with FastCoref", lines=2, value=default),
|
28 |
+
outputs="html").queue()
|
29 |
iface.launch()
|