changxin commited on
Commit
06b2416
1 Parent(s): d0764a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,7 +6,7 @@ from docx import Document
6
  def wd(x):
7
  doc=Document(x)
8
  all_paragraphs = document.paragraphs
9
- t=pd.DataFrame([y.text for paragraph in all_paragraphs])
10
  return t
11
 
12
  demo=gr.Blocks(css="#jsc:hover{background-color: red;}")
@@ -14,7 +14,7 @@ with demo:
14
  with gr.Tabs():
15
  with gr.TabItem("读取word"):
16
  file_input = gr.File(file_count="single",label="请选择需要读取的word文件",show_label=True)
17
- text_output = gr.DataFrame(label="输出读取文本",show_label=True)
18
  dq_button = gr.Button("开始读取>>")
19
  dq_button.click(wd, inputs=file_input, outputs=text_output,api_name="word-text")
20
 
 
6
  def wd(x):
7
  doc=Document(x)
8
  all_paragraphs = document.paragraphs
9
+ t=all_paragraphs[0].text
10
  return t
11
 
12
  demo=gr.Blocks(css="#jsc:hover{background-color: red;}")
 
14
  with gr.Tabs():
15
  with gr.TabItem("读取word"):
16
  file_input = gr.File(file_count="single",label="请选择需要读取的word文件",show_label=True)
17
+ text_output = gr.Textbox(label="输出读取文本",show_label=True)
18
  dq_button = gr.Button("开始读取>>")
19
  dq_button.click(wd, inputs=file_input, outputs=text_output,api_name="word-text")
20