Eldalyai / app.py
Sameh891's picture
Create app.py
76449b5 verified
raw
history blame contribute delete
760 Bytes
import gradio as gr
from transformers import pipeline
# تحميل موديل التلخيص
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
# الدالة الرئيسية
def summarize(text):
if not text.strip():
return "Please enter text to summarize."
result = summarizer(text, max_length=200, min_length=60, do_sample=False)
return result[0]['summary_text']
# واجهة Gradio
iface = gr.Interface(
fn=summarize,
inputs=gr.Textbox(lines=10, placeholder="Paste your physiotherapy research text here..."),
outputs="text",
title="AI Physiotherapy Research Summarizer",
description="Paste any physiotherapy research abstract or text below to get a clear, concise summary."
)
iface.launch()