Spaces:
Runtime error
Runtime error
Commit
·
6df46b0
1
Parent(s):
b32ceac
SOTA summarisation
Browse files
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
|
5 |
+
def main(article):
|
6 |
+
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
7 |
+
|
8 |
+
return summarizer(article, max_length=130, min_length=30, do_sample=False)[0]['summary_text']
|
9 |
+
|
10 |
+
|
11 |
+
iface = gr.Interface(fn=main,
|
12 |
+
inputs=gr.inputs.Textbox(lines=5, label="Article text"),
|
13 |
+
outputs="text")
|
14 |
+
iface.launch()
|