HuangHai 1 week ago
commit 1df3899f7c

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.10 (6)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="D:\anaconda3\envs\py310" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">

@ -3,5 +3,5 @@
<component name="Black">
<option name="sdkName" value="D:\anaconda3\envs\lightrag" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (6)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="D:\anaconda3\envs\py310" project-jdk-type="Python SDK" />
</project>

@ -37,9 +37,18 @@ tasks = [
# { # 数学
# "workspace": "Math", "docx_name": "Math.docx",
# },
{ # 史记
"workspace": "ShiJi", "docx_name": "少年读史记张嘉骅.docx",
},
# { # 史记
# "workspace": "ShiJi", "docx_name": "少年读史记张嘉骅.docx",
# },
# { # 长春市一批次高中学校介绍
# "workspace": "ChangChun", "docx_name": "长春市一批次高中学校介绍.docx",
# },
# { # 2024长春43所高中录取分数线
# "workspace": "ChangChun", "docx_name": "2024长春43所高中录取分数线.docx",
# },
{ # 长春市2025年中考各批次录取最低控制线
"workspace": "ChangChun", "docx_name": "长春市2025年中考各批次录取最低控制线.docx",
}
]
for task in tasks:
task["docx_path"] = "./static/Txt/" + task["docx_name"] # 3、文档路径 python是按引用传递的&

@ -0,0 +1,441 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>【长春市高中报考知识库】</title>
<link rel="icon" href="data:,">
<style>
body {
font-family: 'Microsoft YaHei', sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
h1 {
color: #333;
text-align: center;
}
.data-area {
background-color: white;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.input-area {
background-color: white;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
textarea {
width: 100%;
height: 40px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
resize: none;
margin-bottom: 10px;
margin-right: 20px;
}
button {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
margin-right: 10px;
}
button:hover {
background-color: #45a049;
}
#clearBtn {
background-color: #f44336;
}
#clearBtn:hover {
background-color: #d32f2f;
}
#saveWordBtn {
background-color: #2196F3;
}
.icon {
margin-right: 5px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.doc-links {
display: flex;
gap: 20px;
margin: 20px 0;
align-items: center;
}
.doc-checkboxes {
display: flex;
gap: 20px;
margin-bottom: 10px;
}
.doc-checkboxes label {
display: flex;
align-items: center;
gap: 5px;
cursor: pointer;
}
.examples {
margin: 20px 0;
}
.example-category {
margin-bottom: 15px;
}
.example-category h3 {
margin-bottom: 10px;
color: #333;
}
.example-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.example-item {
padding: 8px 12px;
background-color: #e9f5ff;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
}
.example-item:hover {
background-color: #d0e3fa;
}
.input-area textarea#questionInput {
margin-right: 10px !important;
width: calc(100% - 10px);
box-sizing: border-box;
}
#answerArea {
min-height: 240px;
height: auto;
overflow-y: auto;
max-height: 500px;
}
.loading-animation {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 200px;
color: #666;
}
.spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>【长春市高中报考知识库】</h1>
<div class="data-area" id="answerArea">
<div style="color:#666; padding:20px; text-align:center;">
<p>请在下方输入您的问题,答案将在此处显示</p>
<p>您也可以点击"示例问题"快速体验</p>
</div>
</div>
<div class="input-area">
<label for="questionInput"></label><textarea id="questionInput" placeholder="请输入您的问题..."></textarea>
<div class="examples">
<div class="example-category">
<h3>问题示例</h3>
<div class="example-list">
<div class="example-item" onclick="fillExample('第一批次的高中都有哪些?')">
第一批次的高中都有哪些
</div>
<div class="example-item" onclick="fillExample('2024年考师大自由校区需要多少分')">
2024年考师大自由校区需要多少分?
</div>
<div class="example-item" onclick="fillExample('2025年各批次最低分数线是多少')">
2025年各批次最低分数线是多少?
</div>
<div class="example-item" onclick="fillExample('介绍一下师大自由校区?')">
介绍一下师大自由校区?
</div>
</div>
</div>
</div>
</div>
<button id="submitBtn" onclick="submitQuestion()"><span class="icon">💡</span>提问</button>
<button id="clearBtn" onclick="clearAll()"><span class="icon">🗑️</span>清空</button>
</div>
<script>
// 在页面加载时显示加载动画
document.addEventListener('DOMContentLoaded', function () {
const answerArea = document.getElementById('answerArea');
answerArea.innerHTML = '<div class="loading-animation"><div class="spinner"></div><div>正在加载资源...</div></div>';
// 禁用所有按钮
const buttons = document.querySelectorAll('button');
buttons.forEach(btn => btn.disabled = true);
});
MathJax = {
loader: {load: ['[tex]/mhchem']},
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$'], ['\\[', '\\]']],
packages: {'[+]': ['mhchem']}
},
options: {
enableMenu: false,
processHtmlClass: 'tex2jax_process',
ignoreHtmlClass: 'tex2jax_ignore'
},
svg: {
fontCache: 'global'
},
startup: {
pageReady: () => {
return MathJax.startup.defaultPageReady().then(() => {
console.log('MathJax initialized');
// 移除加载动画并启用所有按钮
const answerArea = document.getElementById('answerArea');
answerArea.innerHTML = '<div style="color:#666; padding:20px; text-align:center;"><p>请在下方输入您的问题,答案将在此处显示</p><p>您也可以点击"示例问题"快速体验</p></div>';
const buttons = document.querySelectorAll('button');
buttons.forEach(btn => btn.disabled = false);
return MathJax.typesetPromise();
});
}
}
};
// marked配置
const markedOptions = {
mangle: false,
headerIds: false
};
function fillExample(question) {
document.getElementById('questionInput').value = question;
}
function submitQuestion() {
const question = document.getElementById('questionInput').value.trim();
const answerArea = document.getElementById('answerArea');
const topic = 'ChangChun';
const mode = 'hybrid';
if (!question) {
alert('请输入问题!');
return;
}
// 添加加载动画
answerArea.innerHTML = '<div class="loading-animation"><div class="spinner"></div><div>思考中...</div></div>';
fetch('/api/rag', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'text/event-stream'
},
body: JSON.stringify({
query: question,
topic: topic,
mode: mode
})
})
.then(response => {
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = '';
let accumulatedContent = '';
function processChunk() {
return reader.read().then(({done, value}) => {
if (done) return;
buffer += decoder.decode(value, {stream: true});
const lines = buffer.split('\n');
buffer = lines.pop();
for (const line of lines) {
if (line.includes('data:')) {
const jsonStr = line.replace(/^data:\s*/, '').replace(/^data:\s*/, '').trim();
if (jsonStr) {
try {
const data = JSON.parse(jsonStr);
if (data.reply) {
accumulatedContent += data.reply;
answerArea.innerHTML = marked.parse(accumulatedContent, markedOptions);
MathJax.typesetPromise();
}
} catch (e) {
console.log('忽略解析错误:', e);
}
}
}
}
return processChunk().then(() => {
// 在流处理完成后保存完整的markdown内容
localStorage.setItem('lastMarkdownContent', accumulatedContent);
});
});
}
return processChunk();
})
.catch(error => {
// 移除加载动画
answerArea.innerHTML = '';
console.error('Error:', error);
// 出错时也移除加载动画
answerArea.innerHTML = '<div style="color:red">请求出错,请重试</div>';
});
}
function clearAll() {
document.getElementById('questionInput').value = '';
document.getElementById('answerArea').innerHTML = '';
}
// 在script部分添加新函数
function generateRelation(query) {
const answerArea = document.getElementById('answerArea');
answerArea.innerHTML = '<div class="loading-animation"><div class="spinner"></div><div>正在生成人物关系图...</div></div>';
fetch('/api/rag', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'text/event-stream'
},
body: JSON.stringify({
query: query,
topic: "ShiJi",
mode: "hybrid",
output_model: "html"
})
})
.then(response => {
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = '';
let accumulatedContent = '';
function processChunk() {
return reader.read().then(({done, value}) => {
if (done) return;
buffer += decoder.decode(value, {stream: true});
const lines = buffer.split('\n');
buffer = lines.pop();
for (const line of lines) {
if (line.includes('[DONE]')) {
// 在这里处理流结束的逻辑
console.log('SSE流处理完成');
return fetch('/api/render_html', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
html_content: accumulatedContent
})
}).then(response => response.json())
.then(data => {
if (data.url) {
window.location = data.url;
}
});
}
if (line.includes('data:')) {
const jsonStr = line.replace(/^data:\s*/, '').replace(/^data:\s*/, '').trim();
if (jsonStr) {
try {
const data = JSON.parse(jsonStr);
if (data.reply) {
accumulatedContent += data.reply;
answerArea.innerHTML = marked.parse(accumulatedContent, markedOptions);
MathJax.typesetPromise();
// 自动滚动到底部
answerArea.scrollTop = answerArea.scrollHeight;
}
} catch (e) {
console.log('忽略解析错误:', e);
}
}
}
}
return processChunk().then(() => {
// 在流处理完成后保存完整的markdown内容
//localStorage.setItem('lastMarkdownContent', accumulatedContent);
});
});
}
return processChunk();
})
.catch(error => {
// 移除加载动画
answerArea.innerHTML = '';
console.error('Error:', error);
// 出错时也移除加载动画
answerArea.innerHTML = '<div style="color:red">请求出错,请重试</div>';
});
}
</script>
<script src="/static/mathjax/es5/tex-mml-chtml.js" id="MathJax-script" async></script>
<script src="/static/js/marked.min.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

File diff suppressed because it is too large Load Diff

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="D:\anaconda3\envs\raganything" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="D:\anaconda3\envs\raganything" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="D:\anaconda3\envs\raganything" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/dsOcr.iml" filepath="$PROJECT_DIR$/.idea/dsOcr.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -0,0 +1,35 @@
| | | | |
| --------- | -------------------- | ---- | ----- |
| 一批次666 | 东北师范大学附属中学 | 统招 | 721.6 |
| | 长春市十一高 | 统招 | 710.1 |
| | 长春市二中 | 统招 | 697 |
| | 吉林省实验中学 | 统招 | 690.1 |
| | 长春外国语 | 统招 | 689.6 |
| | 长春市第二实验 | 统招 | 682.1 |
| | 长春市实验 | 统招 | 676.8 |
| | 长春市六中 | 统招 | 666 |
| | 长春汽车厂六中 | 统招 | 666 |
| 二批次586 | 师大青华 | 私立 | 705.6 |
| | 吉大 | 私立 | 701.1 |
| | 二中精致 | 私立 | 687.3 |
| | 八中 | 统招 | 677 |
| | 五中 | 统招 | 664 |
| | 省实验繁荣 | 私立 | 662.3 |
| | 希望 | 统招 | 651.4 |
| | 师大净月慧泽 | 私立 | 651 |
| | 北师大博硕 | 私立 | 646.9 |
| | 十七中 | 统招 | 643.3 |
| | 汽三 | 统招 | 637.6 |
| | 一中 | 统招 | 633.5 |
| | 北湖 | 私立 | 630.5 |
| | 二十九中 | 统招 | 624.8 |
| | 养正 | 统招 | 623.3 |
| | 十中 | 统招 | 620.5 |
| | 文理 | 私立 | 616.4 |
| | 七中 | 统招 | 614.4 |
| | 朝中 | 统招 | 613.8 |
| | 一三七中学 | 统招 | 611.8 |
| | 解放 | 私立 | 608.2 |
| | 力旺 | 私立 | 586 |
| | 日章学园 | 私立 | 586 |
| | 清浦 | 私立 | 586 |

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 KiB

@ -0,0 +1,5 @@
私有化部署MinerU 与应用实践
https://article.juejin.cn/post/7490746158648475657
在线解析图片
https://mineru.net/OpenSourceTools/Extractor

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

@ -0,0 +1,7 @@
长春市2025年中考各批次录取最低控制线确定如下
第一批次城区普通高中 689分
第二批次城区普通高中 590分
第三批次城区普通高中 573分
中等职业学校的综合高中班录取不低于第三批次城区普通高中最低控制线下60分。
来源:长春市教育考试院
Loading…
Cancel
Save