QINGCHE commited on
Commit
2fcd7a2
·
1 Parent(s): cbc1d23

fix UI bug

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. textInput.py +2 -2
app.py CHANGED
@@ -10,8 +10,8 @@ with gr.Blocks() as demo:
10
  #用markdown语法编辑输出一段话
11
  gr.Markdown("# 文本分类系统")
12
  gr.Markdown("请选择要输入的文件或填入文本")
13
- topic_num = gr.Textbox()
14
- max_length = gr.Textbox()
15
  with gr.Tabs():
16
  with gr.Tab("文本输入"):
17
  text_input = gr.Textbox()
 
10
  #用markdown语法编辑输出一段话
11
  gr.Markdown("# 文本分类系统")
12
  gr.Markdown("请选择要输入的文件或填入文本")
13
+ topic_num = gr.Textbox("主题数")
14
+ max_length = gr.Textbox("摘要最大长度")
15
  with gr.Tabs():
16
  with gr.Tab("文本输入"):
17
  text_input = gr.Textbox()
textInput.py CHANGED
@@ -1,10 +1,10 @@
1
  import run
2
 
3
- def text_dump_to_json(text):
4
  lines = [x.strip() for x in text.split("\n") if x.strip()!='']
5
  data = {"text":lines}
6
  sentences = run.texClear(lines)
7
- keys, output = run.textToAb(sentences,lines,5,50)
8
  return keys, output
9
 
10
  def file_dump_to_json(file):
 
1
  import run
2
 
3
+ def text_dump_to_json(text,topic_num,max_length):
4
  lines = [x.strip() for x in text.split("\n") if x.strip()!='']
5
  data = {"text":lines}
6
  sentences = run.texClear(lines)
7
+ keys, output = run.textToAb(sentences,lines,topic_num,max_length)
8
  return keys, output
9
 
10
  def file_dump_to_json(file):