mirror of
https://github.com/tcsenpai/easy-web-summarizer.git
synced 2025-06-06 02:25:20 +00:00
22 lines
420 B
Python
22 lines
420 B
Python
import gradio as gr
|
|
|
|
from summarizer import load_document, setup_summarization_chain
|
|
|
|
|
|
def summarize(url):
|
|
docs = load_document(url)
|
|
llm_chain = setup_summarization_chain()
|
|
result = llm_chain.run(docs)
|
|
return result
|
|
|
|
|
|
iface = gr.Interface(
|
|
fn=summarize,
|
|
inputs="text",
|
|
outputs="text",
|
|
title="Summarizer",
|
|
description="Enter a URL to get a summary of the document.",
|
|
)
|
|
|
|
iface.launch()
|