htmltotext / app.py
zjrwtx's picture
Create app.py
7bd0514
raw
history blame contribute delete
339 Bytes
import gradio as gr
from bs4 import BeautifulSoup
def html_to_text(html):
soup = BeautifulSoup(html, 'html.parser')
text = soup.get_text()
return text
iface = gr.Interface(
fn=html_to_text,
inputs=gr.Textbox(lines=15, label="输入HTML"),
outputs=gr.Textbox(label="文本输出"),
live=True
)
iface.launch()