| 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() |
|
|