hellopahe commited on
Commit
35415c6
·
1 Parent(s): 96f42d2
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -100,7 +100,7 @@ lex = LexRank()
100
 
101
  def randeng_extract(content):
102
  sentences = lex.find_central(content)
103
- return "原文\n".join((sentence + "\n") for sentence in sentences) \
104
  + "\n摘要\n" \
105
  + str(list(t_randeng.extract(sentence) for sentence in sentences))
106
 
@@ -121,7 +121,7 @@ with gr.Blocks() as app:
121
  gr.Markdown("从下面的标签选择测试模块 [摘要生成,相似度检测]")
122
  with gr.Tab("LexRank->Randeng-Pegasus-523M"):
123
  text_input_1 = gr.Textbox(label="请输入长文本:", max_lines=1000)
124
- text_output_1 = gr.Textbox(label="摘要文本")
125
  text_button_1 = gr.Button("生成摘要")
126
  # with gr.Tab("LexRank->Tuoling-6B-chatGLM"):
127
  # text_input = gr.Textbox(label="请输入长文本:", max_lines=1000)
 
100
 
101
  def randeng_extract(content):
102
  sentences = lex.find_central(content)
103
+ return str(list((f"{str(index)}: " + sentence + "\n") for index, sentence in enumerate(sentences))) \
104
  + "\n摘要\n" \
105
  + str(list(t_randeng.extract(sentence) for sentence in sentences))
106
 
 
121
  gr.Markdown("从下面的标签选择测试模块 [摘要生成,相似度检测]")
122
  with gr.Tab("LexRank->Randeng-Pegasus-523M"):
123
  text_input_1 = gr.Textbox(label="请输入长文本:", max_lines=1000)
124
+ text_output_1 = gr.Textbox(label="摘要文本", lines=10)
125
  text_button_1 = gr.Button("生成摘要")
126
  # with gr.Tab("LexRank->Tuoling-6B-chatGLM"):
127
  # text_input = gr.Textbox(label="请输入长文本:", max_lines=1000)