Spaces:
Runtime error
Runtime error
initial commit
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
summarizer = pipeline("summarization")
|
| 6 |
+
|
| 7 |
+
def summarize(text):
|
| 8 |
+
return summarizer(text, max_length=250, min_length=30)[0]['summary_text']
|
| 9 |
+
|
| 10 |
+
gr.Interface(
|
| 11 |
+
summarize,
|
| 12 |
+
gr.inputs.Textbox(lines=15, placeholder="Enter text here"),
|
| 13 |
+
[gr.outputs.Textbox(lines=10, placeholder="Summarized text will appear here")],
|
| 14 |
+
title="Text Summarizer",
|
| 15 |
+
description="Summarizes text using the transformer library",
|
| 16 |
+
examples=[]
|
| 17 |
+
).launch()
|