Skip to content

Commit 6d9f3ad

Browse files
committed
docs: 将 PaddleX 统一更新为 PP-StructureV3
更新文档、代码注释和变量命名,将 PaddleX 统一替换为 PP-StructureV3 以反映实际使用的技术栈
1 parent 22fc138 commit 6d9f3ad

File tree

8 files changed

+59
-33
lines changed

8 files changed

+59
-33
lines changed

docs/latest/advanced/document-processing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- **RapidOCR**: CPU 友好,无需 GPU,适合基础文字识别
66
- **MinerU**: 本地化高精度 VLM 解析,适合复杂 PDF 和表格文档
77
- **MinerU Official**: 官方云服务 API,无需本地部署,开箱即用
8-
- **PaddleX**: 结构化解析,适合表格、票据等特殊格式
8+
- **PP-StructureV3**: 结构化解析,适合表格、票据等特殊格式
99
- **DeepSeek OCR**: 基于 SiliconFlow API 的 DeepSeek OCR OCR 服务
1010

1111
## 支持的文件类型
@@ -83,17 +83,17 @@ MINERU_API_KEY="your-api-key-here"
8383

8484
然后使用 `docker compose up api -d` 重启后端服务。
8585

86-
### 4. 结构化解析 (PaddleX)
86+
### 4. 结构化解析 (PP-StructureV3)
8787

8888
```bash
89-
# 需要 GPU,启动 PaddleX 服务
89+
# 需要 GPU,启动 PP-StructureV3 服务
9090
docker compose up -d paddlex
9191

9292
# 启动主服务
9393
docker compose up -d api
9494
```
9595

96-
### 5. 智能云端 OCR (DeepSeek OCR)
96+
### 5. DeepSeek OCR (SiliconFlow)
9797

9898
DeepSeek OCR 基于 SiliconFlow API,提供智能文档理解和 Markdown 格式输出。
9999

@@ -121,7 +121,7 @@ docker compose restart api
121121
| **RapidOCR** | 基础文字识别 | CPU | 速度快,资源占用低 |
122122
| **MinerU** | 复杂 PDF、表格、公式 | GPU | 精度高,版面分析好 |
123123
| **MinerU Official** | 复杂文档解析(云服务) | 无特殊要求 | 官方云服务,开箱即用,有 API 配额 |
124-
| **PaddleX** | 表格、票据、结构化文档 | GPU | 专业版面解析 |
124+
| **PP-StructureV3** | 表格、票据、结构化文档 | GPU | 专业版面解析 |
125125
| **DeepSeek OCR** | 智能文档理解和 Markdown 输出 | 无特殊要求 | 云端服务 |
126126

127127
## 参数说明
@@ -134,12 +134,12 @@ docker compose restart api
134134
- `onnx_rapid_ocr`: RapidOCR 处理
135135
- `mineru_ocr`: MinerU HTTP API 处理
136136
- `mineru_official`: MinerU 官方云服务 API 处理
137-
- `paddlex_ocr`: PaddleX 处理
137+
- `paddlex_ocr`: PP-StructureV3 处理
138138
- `deepseek_ocr`: DeepSeek OCR(SiliconFlow API)处理
139139

140140
### 注意事项
141141
- **图片文件必须启用 OCR**,否则无法提取内容
142-
- MinerU 和 PaddleX 需要 GPU 支持
142+
- MinerU 和 PP-StructureV3 需要 GPU 支持
143143
- MinerU Official 需要设置 `MINERU_API_KEY` 环境变量
144144
- DeepSeek OCR 需要设置 `SILICONFLOW_API_KEY` 环境变量
145145
- RapidOCR 适合 CPU 环境和基础识别需求

docs/latest/advanced/misc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
| **9000/9001** | MinIO | milvus-minio | 对象存储 |
4444
| **19530/9091** | Milvus | milvus | 向量数据库 |
4545
| **30000** | MinerU | mineru | PDF 解析(可选)|
46-
| **8080** | PaddleX | paddlex-ocr | OCR 服务(可选)|
46+
| **8080** | PP-StructureV3 | paddlex-ocr | OCR 服务(可选)|
4747
| **8081** | vLLM | - | 本地推理(可选)|
4848

4949
::: tip 端口访问

docs/latest/changelog/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
### OCR 模型或服务不可用?
6666
- RapidOCR 本地模型:确保 `MODEL_DIR/SWHL/RapidOCR` 下存在 `PP-OCRv4` 模型
67-
- MinerU/PaddleX:检查健康检查接口与 GPU/CUDA 版本
67+
- MinerU/PP-StructureV3:检查健康检查接口与 GPU/CUDA 版本
6868

6969
### 登录失败被锁定?
7070
- 多次失败会临时锁定账户,请根据提示等待后重试

docs/latest/changelog/roadmap.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
路线图可能会经常变更,如果有强烈的建议,可以在 [issue](https://github.com/xerrors/Yuxi-Know/issues) 中提。
44

5-
## v0.4
5+
v0.5
66

77
### 看板
88

@@ -28,6 +28,8 @@
2828
- 工具传递给模型的时候,使用英文,但部分模型不支持中文函数名(如gpt-4o-mini)
2929
- 首页加载的问题
3030

31+
## v0.4
32+
3133
### 新增
3234
- 新增对于上传附件的智能体中间件,详见[文档](https://xerrors.github.io/Yuxi-Know/latest/advanced/agents-config.html#%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E4%B8%AD%E9%97%B4%E4%BB%B6)
3335
- 新增多模态模型支持(当前仅支持图片),详见[文档](https://xerrors.github.io/Yuxi-Know/latest/advanced/agents-config.html#%E5%A4%9A%E6%A8%A1%E6%80%81%E5%9B%BE%E7%89%87%E6%94%AF%E6%8C%81)

src/plugins/document_processor_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_processor(cls, processor_type: str, **kwargs) -> BaseDocumentProcessor:
4040
- "onnx_rapid_ocr": RapidOCR 本地 OCR
4141
- "mineru_ocr": MinerU HTTP API 文档解析
4242
- "mineru_official": MinerU 官方云服务 API 文档解析
43-
- "paddlex_ocr": PaddleX 版面解析
43+
- "paddlex_ocr": PP-StructureV3 版面解析
4444
- "deepseek_ocr": DeepSeek-OCR SiliconFlow API
4545
**kwargs: 处理器初始化参数
4646

src/plugins/paddlex_parser.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
PaddleX 文档解析器
2+
PP-StructureV3 文档解析器
33
4-
使用 PaddleX PP-StructureV3 进行文档版面解析和内容提取
4+
使用 PP-StructureV3 进行文档版面解析和内容提取
55
"""
66

77
import base64
@@ -17,7 +17,7 @@
1717

1818

1919
class PaddleXDocumentParser(BaseDocumentProcessor):
20-
"""PaddleX 文档解析器 - 使用 PP-StructureV3 进行版面解析"""
20+
"""PP-StructureV3 文档解析器 - 使用 PP-StructureV3 进行版面解析"""
2121

2222
def __init__(self, server_url: str | None = None):
2323
self.server_url = server_url or os.getenv("PADDLEX_URI") or "http://localhost:8080"
@@ -28,7 +28,7 @@ def get_service_name(self) -> str:
2828
return "paddlex_ocr"
2929

3030
def get_supported_extensions(self) -> list[str]:
31-
"""PaddleX 支持 PDF 和多种图像格式"""
31+
"""PP-StructureV3 支持 PDF 和多种图像格式"""
3232
return [".pdf", ".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif"]
3333

3434
def _encode_file_to_base64(self, file_path: str) -> str:
@@ -64,7 +64,7 @@ def _call_layout_api(
6464
use_seal_recognition: bool = False,
6565
**kwargs,
6666
) -> dict[str, Any]:
67-
"""调用PaddleX版面解析API"""
67+
"""调用PP-StructureV3版面解析API"""
6868
# 处理文件输入
6969
processed_file_input = self._process_file_input(file_input)
7070
payload = {"file": processed_file_input}
@@ -92,7 +92,7 @@ def _call_layout_api(
9292
if response.status_code == 200:
9393
return response.json()
9494
else:
95-
error_msg = f"PaddleX API请求失败: {response.status_code}"
95+
error_msg = f"PP-StructureV3 API请求失败: {response.status_code}"
9696
try:
9797
error_result = response.json()
9898
raise DocumentParserException(f"{error_msg}: {error_result}", self.get_service_name(), "api_error")
@@ -157,45 +157,45 @@ def _parse_api_result(self, api_result: dict[str, Any], file_path: str) -> dict[
157157
return parsed_result
158158

159159
def check_health(self) -> dict:
160-
"""检查 PaddleX 服务健康状态"""
160+
"""检查 PP-StructureV3 服务健康状态"""
161161
try:
162162
response = requests.get(f"{self.base_url}/health", timeout=5)
163163

164164
if response.status_code == 200:
165165
return {
166166
"status": "healthy",
167-
"message": "PaddleX 服务运行正常",
167+
"message": "PP-StructureV3 服务运行正常",
168168
"details": {"server_url": self.server_url},
169169
}
170170
else:
171171
return {
172172
"status": "unhealthy",
173-
"message": f"PaddleX 服务响应异常: {response.status_code}",
173+
"message": f"PP-StructureV3 服务响应异常: {response.status_code}",
174174
"details": {"server_url": self.server_url},
175175
}
176176

177177
except requests.exceptions.ConnectionError:
178178
return {
179179
"status": "unavailable",
180-
"message": "PaddleX 服务无法连接,请检查服务是否启动",
180+
"message": "PP-StructureV3 服务无法连接,请检查服务是否启动",
181181
"details": {"server_url": self.server_url},
182182
}
183183
except requests.exceptions.Timeout:
184184
return {
185185
"status": "timeout",
186-
"message": "PaddleX 服务连接超时",
186+
"message": "PP-StructureV3 服务连接超时",
187187
"details": {"server_url": self.server_url},
188188
}
189189
except Exception as e:
190190
return {
191191
"status": "error",
192-
"message": f"PaddleX 健康检查失败: {str(e)}",
192+
"message": f"PP-StructureV3 健康检查失败: {str(e)}",
193193
"details": {"server_url": self.server_url, "error": str(e)},
194194
}
195195

196196
def process_file(self, file_path: str, params: dict | None = None) -> str:
197197
"""
198-
使用 PaddleX 处理文档
198+
使用 PP-StructureV3 处理文档
199199
200200
Args:
201201
file_path: 文件路径
@@ -220,7 +220,7 @@ def process_file(self, file_path: str, params: dict | None = None) -> str:
220220
health = self.check_health()
221221
if health["status"] != "healthy":
222222
raise DocumentParserException(
223-
f"PaddleX 服务不可用: {health['message']}", self.get_service_name(), health["status"]
223+
f"PP-StructureV3 服务不可用: {health['message']}", self.get_service_name(), health["status"]
224224
)
225225

226226
try:
@@ -230,7 +230,7 @@ def process_file(self, file_path: str, params: dict | None = None) -> str:
230230
# 判断文件类型
231231
file_type = 0 if file_ext == ".pdf" else 1
232232

233-
logger.info(f"PaddleX 开始处理: {os.path.basename(file_path)}")
233+
logger.info(f"PP-StructureV3 开始处理: {os.path.basename(file_path)}")
234234

235235
# 调用API
236236
api_result = self._call_layout_api(
@@ -244,15 +244,15 @@ def process_file(self, file_path: str, params: dict | None = None) -> str:
244244
# 检查API调用是否成功
245245
if api_result.get("errorCode") != 0:
246246
raise DocumentParserException(
247-
f"PaddleX API错误: {api_result.get('errorMsg', '未知错误')}", self.get_service_name(), "api_error"
247+
f"PP-StructureV3 API错误: {api_result.get('errorMsg', '未知错误')}", self.get_service_name(), "api_error"
248248
)
249249

250250
# 解析结果
251251
result = self._parse_api_result(api_result, file_path)
252252
text = result.get("full_text", "")
253253

254254
processing_time = time.time() - start_time
255-
logger.info(f"PaddleX 处理成功: {os.path.basename(file_path)} - {len(text)} 字符 ({processing_time:.2f}s)")
255+
logger.info(f"PP-StructureV3 处理成功: {os.path.basename(file_path)} - {len(text)} 字符 ({processing_time:.2f}s)")
256256

257257
# 记录统计信息
258258
summary = result.get("summary", {})
@@ -265,6 +265,6 @@ def process_file(self, file_path: str, params: dict | None = None) -> str:
265265
raise
266266
except Exception as e:
267267
processing_time = time.time() - start_time
268-
error_msg = f"PaddleX 处理失败: {str(e)}"
268+
error_msg = f"PP-StructureV3 处理失败: {str(e)}"
269269
logger.error(f"{error_msg} ({processing_time:.2f}s)")
270270
raise DocumentParserException(error_msg, self.get_service_name(), "processing_failed")

web/src/components/AgentChatComponent.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,10 +1292,34 @@ watch(conversations, () => {
12921292
12931293
.generating-text {
12941294
margin-left: 12px;
1295-
color: var(--gray-700);
12961295
font-size: 14px;
12971296
font-weight: 500;
12981297
letter-spacing: 0.025em;
1298+
/* 恢复灰色调:深灰 -> 亮灰(高光) -> 深灰 */
1299+
background: linear-gradient(
1300+
90deg,
1301+
var(--gray-700) 0%,
1302+
var(--gray-700) 40%,
1303+
var(--gray-300) 45%,
1304+
var(--gray-200) 50%,
1305+
var(--gray-300) 55%,
1306+
var(--gray-700) 60%,
1307+
var(--gray-700) 100%
1308+
);
1309+
background-size: 200% auto;
1310+
-webkit-background-clip: text;
1311+
background-clip: text;
1312+
color: transparent;
1313+
animation: waveFlash 2s linear infinite;
1314+
}
1315+
}
1316+
1317+
@keyframes waveFlash {
1318+
0% {
1319+
background-position: 200% center;
1320+
}
1321+
100% {
1322+
background-position: -200% center;
12991323
}
13001324
}
13011325

web/src/components/FileUploadModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ const enableOcrOptions = computed(() => [
421421
{
422422
value: 'paddlex_ocr',
423423
label: getPaddleXLabel(),
424-
title: 'PaddleX OCR',
424+
title: 'PP-StructureV3',
425425
disabled: ocrHealthStatus.value?.paddlex_ocr?.status === 'unavailable' || ocrHealthStatus.value?.paddlex_ocr?.status === 'error'
426426
},
427427
{
@@ -488,7 +488,7 @@ const getOcrLabel = (serviceKey, displayName) => {
488488
const getRapidOcrLabel = () => getOcrLabel('onnx_rapid_ocr', 'RapidOCR (ONNX)');
489489
const getMinerULabel = () => getOcrLabel('mineru_ocr', 'MinerU OCR');
490490
const getMinerUOfficialLabel = () => getOcrLabel('mineru_official', 'MinerU Official API');
491-
const getPaddleXLabel = () => getOcrLabel('paddlex_ocr', 'PaddleX OCR');
491+
const getPaddleXLabel = () => getOcrLabel('paddlex_ocr', 'PP-StructureV3');
492492
const getDeepSeekOcrLabel = () => getOcrLabel('deepseek_ocr', 'DeepSeek OCR');
493493
494494
// 验证OCR服务可用性
@@ -707,7 +707,7 @@ const chunkData = async () => {
707707
708708
if (hasImageFiles && chunkParams.value.enable_ocr === 'disable') {
709709
message.error({
710-
content: '检测到图片文件,必须启用 OCR 才能提取文本内容。请在上方选择 OCR 方式 (RapidOCR/MinerU/MinerU Official/PaddleX) 或移除图片文件。',
710+
content: '检测到图片文件,必须启用 OCR 才能提取文本内容。请在上方选择 OCR 方式 (RapidOCR/MinerU/MinerU Official/PP-StructureV3) 或移除图片文件。',
711711
duration: 5,
712712
});
713713
return;

0 commit comments

Comments
 (0)