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