fyj commited on
Commit
d216e3a
·
1 Parent(s): a267391

extract pdf

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -142,11 +142,11 @@ def main(api, review_format, paper_pdf, language):
142
  # 创建一个Reader对象
143
  reviewer1 = Reviewer(api, review_format, paper_pdf, language)
144
  # 开始判断是路径还是文件:
145
- # text = reviewer1.extract_chapter(paper_pdf)
146
  comments, total_token_used = reviewer1.review_by_chatgpt(paper_list=paper_pdf)
147
  time_used = time.time() - start_time
148
  output2 ="使用token数:"+ str(total_token_used)+"\n花费时间:"+ str(round(time_used, 2)) +"秒"
149
- return comments, output2
150
 
151
 
152
 
@@ -198,7 +198,7 @@ xxx"""
198
 
199
  chat_reviewer_gui = gradio.Interface(fn=main,
200
  inputs=inp,
201
- outputs = [gradio.Textbox(lines=25, label="分析结果"), gradio.Textbox(lines=2, label="资源统计")],
202
  title=title,
203
  description=description)
204
 
 
142
  # 创建一个Reader对象
143
  reviewer1 = Reviewer(api, review_format, paper_pdf, language)
144
  # 开始判断是路径还是文件:
145
+ text = reviewer1.extract_chapter(paper_pdf)
146
  comments, total_token_used = reviewer1.review_by_chatgpt(paper_list=paper_pdf)
147
  time_used = time.time() - start_time
148
  output2 ="使用token数:"+ str(total_token_used)+"\n花费时间:"+ str(round(time_used, 2)) +"秒"
149
+ return comments, output2,text
150
 
151
 
152
 
 
198
 
199
  chat_reviewer_gui = gradio.Interface(fn=main,
200
  inputs=inp,
201
+ outputs = [gradio.Textbox(lines=25, label="分析结果"), gradio.Textbox(lines=2, label="资源统计"),gradio.Textbox(lines=100, label="文本提取")],
202
  title=title,
203
  description=description)
204