Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
@@ -412,16 +412,18 @@ class Reader:
|
|
412 |
chat_summary_text = self.chat_summary(text=text, key=str(key))
|
413 |
htmls.append(chat_summary_text)
|
414 |
|
415 |
-
# TODO 往md文档中插入论文里的像素最大的一张图片,这个方案可以弄的更加智能一些:
|
416 |
-
first_image, ext = paper.get_image_path()
|
417 |
-
if first_image is None or self.gitee_key == '':
|
418 |
-
|
419 |
-
else:
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
|
|
|
|
425 |
# 第二步总结方法:
|
426 |
# TODO,由于有些文章的方法章节名是算法名,所以简单的通过关键词来筛选,很难获取,后面需要用其他的方案去优化。
|
427 |
method_key = ''
|
@@ -469,6 +471,23 @@ class Reader:
|
|
469 |
# chat_conclusion_text = self.chat_conclusion(text=text, key=str(key))
|
470 |
# htmls.append(chat_conclusion_text)
|
471 |
# htmls.append("\n")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
chat_review_text = self.chat_review(text=text, key=str(key))
|
473 |
htmls.append(chat_review_text)
|
474 |
htmls.append("\n")
|
|
|
412 |
chat_summary_text = self.chat_summary(text=text, key=str(key))
|
413 |
htmls.append(chat_summary_text)
|
414 |
|
415 |
+
# # TODO 往md文档中插入论文里的像素最大的一张图片,这个方案可以弄的更加智能一些:
|
416 |
+
# first_image, ext = paper.get_image_path()
|
417 |
+
# if first_image is None or self.gitee_key == '':
|
418 |
+
# pass
|
419 |
+
# else:
|
420 |
+
# image_title = self.validateTitle(paper.title)
|
421 |
+
# image_url = self.upload_gitee(image_path=first_image, image_name=image_title, ext=ext)
|
422 |
+
# htmls.append("\n")
|
423 |
+
# htmls.append("![Fig]("+image_url+")")
|
424 |
+
# htmls.append("\n")
|
425 |
+
#
|
426 |
+
|
427 |
# 第二步总结方法:
|
428 |
# TODO,由于有些文章的方法章节名是算法名,所以简单的通过关键词来筛选,很难获取,后面需要用其他的方案去优化。
|
429 |
method_key = ''
|
|
|
471 |
# chat_conclusion_text = self.chat_conclusion(text=text, key=str(key))
|
472 |
# htmls.append(chat_conclusion_text)
|
473 |
# htmls.append("\n")
|
474 |
+
experiment_text = ''
|
475 |
+
experiment_key = ''
|
476 |
+
review_text = "<summary>" + chat_summary_text + "\n <Method summary>:\n" + chat_method_text
|
477 |
+
for parse_key in paper.section_text_dict.keys():
|
478 |
+
if 'Experiments' in parse_key.lower() or 'Results' in parse_key.lower():
|
479 |
+
experiment_key = parse_key
|
480 |
+
break
|
481 |
+
if experiment_key != '':
|
482 |
+
# conclusion
|
483 |
+
experiment_text += paper.section_text_dict[experiment_key]
|
484 |
+
max_token = 2500 * 4
|
485 |
+
text = review_text + "\n <Experiments>:\n" + experiment_text
|
486 |
+
else:
|
487 |
+
text = review_text
|
488 |
+
text = text[:max_token]
|
489 |
+
|
490 |
+
|
491 |
chat_review_text = self.chat_review(text=text, key=str(key))
|
492 |
htmls.append(chat_review_text)
|
493 |
htmls.append("\n")
|