Eldalyai / 12
Sameh891's picture
Create 12
a17629e verified
raw
history blame contribute delete
802 Bytes
import gradio as gr
from transformers import pipeline
# تحميل موديل التلخيص المجاني
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
# دالة التلخيص
def summarize(text):
if len(text.strip()) == 0:
return "Please enter some text."
summary = summarizer(text, max_length=200, min_length=60, do_sample=False)
return summary[0]['summary_text']
# واجهة المستخدم
iface = gr.Interface(
fn=summarize,
inputs=gr.Textbox(lines=10, label="Enter Physiotherapy Research Text"),
outputs=gr.Textbox(lines=10, label="Summarized Version"),
title="AI Physiotherapy Research Summarizer",
description="Paste any physiotherapy research abstract or article, and get a clear, concise summary.",
)
iface.launch()