QINGCHE commited on
Commit
8670f86
1 Parent(s): 0fba546
Files changed (2) hide show
  1. app.py +2 -2
  2. textInput.py +1 -1
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.Number(label = "主题数")
14
+ max_length = gr.Number(label="摘要最大长度")
15
  with gr.Tabs():
16
  with gr.Tab("文本输入"):
17
  text_input = gr.Textbox()
textInput.py CHANGED
@@ -3,7 +3,7 @@ import run
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
  sentences = run.texClear(lines)
6
- keys, output = run.textToAb(sentences,lines,topic_num,max_length)
7
  keysText = "\n".join(keys)
8
  outputText = "\n".join(output)
9
  return keys, output
 
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
  sentences = run.texClear(lines)
6
+ keys, output = run.textToAb(sentences,lines,int(topic_num),int(max_length))
7
  keysText = "\n".join(keys)
8
  outputText = "\n".join(output)
9
  return keys, output