hellopahe commited on
Commit
be53140
·
1 Parent(s): e0738a2

add luotuo summary

Browse files
Files changed (2) hide show
  1. app.py +9 -13
  2. util.py → luotuo_util.py +0 -0
app.py CHANGED
@@ -92,7 +92,7 @@ class LexRank(object):
92
 
93
  # ---===--- worker instances ---===---
94
  t_randeng = SummaryExtractor()
95
- t_tuoling = Tuoling_6B_extractor()
96
 
97
  embedder = Embed()
98
  lex = LexRank()
@@ -102,9 +102,9 @@ def randeng_extract(content):
102
  sentences = lex.find_central(content)
103
  return str(list(t_randeng.extract(sentence) for sentence in sentences))
104
 
105
- def tuoling_extract(content):
106
- sentences = lex.find_central(content)
107
- return str(list(t_tuoling.extract(sentence) for sentence in sentences))
108
 
109
  def similarity_check(query, doc):
110
  doc_list = doc.split("\n")
@@ -117,18 +117,14 @@ def similarity_check(query, doc):
117
 
118
  with gr.Blocks() as app:
119
  gr.Markdown("从下面的标签选择测试模块 [摘要生成,相似度检测]")
120
- # with gr.Tab("CamelBell-Chinese-LoRA"):
121
- # text_input = gr.Textbox()
122
- # text_output = gr.Textbox()
123
- # text_button = gr.Button("生成摘要")
124
  with gr.Tab("LexRank->Randeng-Pegasus-523M"):
125
  text_input_1 = gr.Textbox(label="请输入长文本:", max_lines=1000)
126
  text_output_1 = gr.Textbox(label="摘要文本")
127
  text_button_1 = gr.Button("生成摘要")
128
- with gr.Tab("LexRank->Tuoling-6B-chatGLM"):
129
- text_input = gr.Textbox(label="请输入长文本:", max_lines=1000)
130
- text_output = gr.Textbox(label="摘要文本")
131
- text_button = gr.Button("生成摘要")
132
  with gr.Tab("相似度检测"):
133
  with gr.Row():
134
  text_input_query = gr.Textbox(label="查询文本")
@@ -136,7 +132,7 @@ with gr.Blocks() as app:
136
  text_button_similarity = gr.Button("对比相似度")
137
  text_output_similarity = gr.Textbox()
138
 
139
- text_button.click(tuoling_extract, inputs=text_input, outputs=text_output)
140
  text_button_1.click(randeng_extract, inputs=text_input_1, outputs=text_output_1)
141
  text_button_similarity.click(similarity_check, inputs=[text_input_query, text_input_doc], outputs=text_output_similarity)
142
 
 
92
 
93
  # ---===--- worker instances ---===---
94
  t_randeng = SummaryExtractor()
95
+ # t_tuoling = Tuoling_6B_extractor()
96
 
97
  embedder = Embed()
98
  lex = LexRank()
 
102
  sentences = lex.find_central(content)
103
  return str(list(t_randeng.extract(sentence) for sentence in sentences))
104
 
105
+ # def tuoling_extract(content):
106
+ # sentences = lex.find_central(content)
107
+ # return str(list(t_tuoling.extract(sentence) for sentence in sentences))
108
 
109
  def similarity_check(query, doc):
110
  doc_list = doc.split("\n")
 
117
 
118
  with gr.Blocks() as app:
119
  gr.Markdown("从下面的标签选择测试模块 [摘要生成,相似度检测]")
 
 
 
 
120
  with gr.Tab("LexRank->Randeng-Pegasus-523M"):
121
  text_input_1 = gr.Textbox(label="请输入长文本:", max_lines=1000)
122
  text_output_1 = gr.Textbox(label="摘要文本")
123
  text_button_1 = gr.Button("生成摘要")
124
+ # with gr.Tab("LexRank->Tuoling-6B-chatGLM"):
125
+ # text_input = gr.Textbox(label="请输入长文本:", max_lines=1000)
126
+ # text_output = gr.Textbox(label="摘要文本")
127
+ # text_button = gr.Button("生成摘要")
128
  with gr.Tab("相似度检测"):
129
  with gr.Row():
130
  text_input_query = gr.Textbox(label="查询文本")
 
132
  text_button_similarity = gr.Button("对比相似度")
133
  text_output_similarity = gr.Textbox()
134
 
135
+ # text_button.click(tuoling_extract, inputs=text_input, outputs=text_output)
136
  text_button_1.click(randeng_extract, inputs=text_input_1, outputs=text_output_1)
137
  text_button_similarity.click(similarity_check, inputs=[text_input_query, text_input_doc], outputs=text_output_similarity)
138
 
util.py → luotuo_util.py RENAMED
File without changes