add article
Browse files
app.py
CHANGED
@@ -17,14 +17,16 @@ def viz(topic_id):
|
|
17 |
ex = [{"text": summary,
|
18 |
"ents": [{"start": token.idx, "end": token.idx + token.__len__() + 1, "label": label[:3]} for token, label in zip(nlp(summary), labels) if label != "correct"],
|
19 |
"title": None}]
|
20 |
-
return displacy.render(ex, style="ent", manual=True, options=options), score
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
demo = gr.Interface(fn=viz,
|
26 |
inputs=[gr.Dropdown(df.index.tolist(), label="Select Topic Id")],
|
27 |
-
outputs=["
|
|
|
|
|
28 |
|
29 |
|
30 |
|
|
|
17 |
ex = [{"text": summary,
|
18 |
"ents": [{"start": token.idx, "end": token.idx + token.__len__() + 1, "label": label[:3]} for token, label in zip(nlp(summary), labels) if label != "correct"],
|
19 |
"title": None}]
|
20 |
+
return row["article"], displacy.render(ex, style="ent", manual=True, options=options), score
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
demo = gr.Interface(fn=viz,
|
26 |
inputs=[gr.Dropdown(df.index.tolist(), label="Select Topic Id")],
|
27 |
+
outputs=[gr.Text(label="Source article"),
|
28 |
+
gr.HTML(label="summary"),
|
29 |
+
gr.Number(label="score")])
|
30 |
|
31 |
|
32 |
|