Spaces:
Runtime error
Runtime error
cleaning up entity recognition output
Browse files
app.py
CHANGED
@@ -9,10 +9,11 @@ def get_entities(article):
|
|
9 |
|
10 |
def make_summary(article, max_length=130, min_length=30, do_sample=False):
|
11 |
summ = summarizer(article, max_length, min_length, do_sample)[0]
|
12 |
-
ents = get_entities(article)
|
13 |
-
|
|
|
14 |
|
15 |
|
16 |
|
17 |
-
iface = gr.Interface(fn=make_summary, inputs="text", outputs=['text', '
|
18 |
iface.launch()
|
9 |
|
10 |
def make_summary(article, max_length=130, min_length=30, do_sample=False):
|
11 |
summ = summarizer(article, max_length, min_length, do_sample)[0]
|
12 |
+
ents = get_entities(article)
|
13 |
+
entslen = len(ents[0].keys())
|
14 |
+
return summ.get('summary_text'), entslen, ents
|
15 |
|
16 |
|
17 |
|
18 |
+
iface = gr.Interface(fn=make_summary, inputs="text", outputs=['text', 'int', 'text'])
|
19 |
iface.launch()
|