skhage commited on
Commit
fefb2c2
1 Parent(s): f0efdad

cleaning up entity recognition output

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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)[0]
13
- return summ.get('summary_text'), type(ents), ents
 
14
 
15
 
16
 
17
- iface = gr.Interface(fn=make_summary, inputs="text", outputs=['text', 'text', '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()