skhage commited on
Commit
afc6983
1 Parent(s): 03cb6c9

added ner as output

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -4,11 +4,13 @@ from transformers import pipeline
4
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
5
  ner = pipeline("ner", aggregation_strategy="simple")
6
 
7
- def make_summary(article, max_length=130, min_length=30, do_sample=False):
8
- return summarizer(article, max_length, min_length, do_sample)
9
-
10
  def get_entities(article):
11
  return ner(article)
 
 
 
 
 
12
 
13
- iface = gr.Interface(fn=make_summary, inputs="text", outputs="text")
14
  iface.launch()
 
4
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
5
  ner = pipeline("ner", aggregation_strategy="simple")
6
 
 
 
 
7
  def get_entities(article):
8
  return ner(article)
9
+
10
+ def make_summary(article, max_length=130, min_length=30, do_sample=False):
11
+ return summarizer(article, max_length, min_length, do_sample), get_entities(article)
12
+
13
+
14
 
15
+ iface = gr.Interface(fn=make_summary, inputs="text", outputs=['text', 'text'])
16
  iface.launch()