|
|
|
@ -2,8 +2,8 @@ import asyncio
|
|
|
|
|
import os
|
|
|
|
|
import shutil
|
|
|
|
|
from raganything import RAGAnything, RAGAnythingConfig
|
|
|
|
|
from Util.LightRagUtil import create_llm_model_func, create_embedding_func, create_vision_model_func
|
|
|
|
|
|
|
|
|
|
from Util.LightRagUtil import create_llm_model_func, create_embedding_func, create_vision_model_func, \
|
|
|
|
|
format_exam_content
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
|
|
# 在程序开始时添加以下配置
|
|
|
|
@ -25,7 +25,7 @@ async def main():
|
|
|
|
|
file_path = "Docx/《动能定理》巩固练习.docx"
|
|
|
|
|
WORKING_DIR = "../Topic/WuLi"
|
|
|
|
|
fileName = file_path.split('/')[-1].replace(".docx", "").replace(".doc", "")
|
|
|
|
|
print("文件名="+fileName)
|
|
|
|
|
print("文件名=" + fileName)
|
|
|
|
|
|
|
|
|
|
# 删除output目录下的所有文件
|
|
|
|
|
output_dir = "../output"
|
|
|
|
@ -90,8 +90,7 @@ async def main():
|
|
|
|
|
f.write(content)
|
|
|
|
|
|
|
|
|
|
# 新增:使用大模型整理内容
|
|
|
|
|
from Util.LightRagUtil import format_exam_content
|
|
|
|
|
formatted_content = format_exam_content(
|
|
|
|
|
format_exam_content(
|
|
|
|
|
client=llm_model_func(),
|
|
|
|
|
raw_text=content,
|
|
|
|
|
output_path=os.path.join(output_dir, "整理后的结果.md")
|
|
|
|
|