zjrwtx commited on
Commit
7bd0514
1 Parent(s): 54198f0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from bs4 import BeautifulSoup
3
+
4
+ def html_to_text(html):
5
+ soup = BeautifulSoup(html, 'html.parser')
6
+ text = soup.get_text()
7
+ return text
8
+
9
+ iface = gr.Interface(
10
+ fn=html_to_text,
11
+ inputs=gr.Textbox(lines=15, label="输入HTML"),
12
+ outputs=gr.Textbox(label="文本输出"),
13
+ live=True
14
+ )
15
+
16
+ iface.launch()