Spaces:
Sleeping
Sleeping
File size: 622 Bytes
2efb1a7 4f5b174 12f450c 4f5b174 3e6e828 12f450c 3e6e828 4f5b174 f3257b1 12f450c 4f5b174 3e6e828 c0e93d3 4f5b174 3e6e828 643cb76 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from transformers import pipeline
import gradio as gr
summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-small", truncation=True, framework="tf")
def analyze_text(text):
# here text line of code is optional
text = text.replace('"', '""')
text = text.replace(''', "''")
text = text.replace('&', "&")
result = summarizer(text, min_length=180, truncation=True)
return result[0]['summary_text']
iface = gr.Interface(
fn=analyze_text,
inputs=gr.Textbox(placeholder="Enter or paste your Text and press Submit."),
outputs="text"
)
iface.launch(share=True)
|