Feat: Refact pipeline (#13826)

### What problem does this PR solve?

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring

---------

Co-authored-by: Zhichang Yu <yuzhichang@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Magicbook1108
2026-04-03 19:26:45 +08:00
committed by GitHub
parent 6d9430a125
commit 69264b3a70
71 changed files with 3055 additions and 990 deletions

View File

@@ -41,6 +41,8 @@ except Exception:
class RAGFlowPdfParser:
pass
from deepdoc.parser.utils import extract_pdf_outlines
class DoclingContentType(str, Enum):
IMAGE = "image"
@@ -242,7 +244,7 @@ class DoclingParser(RAGFlowPdfParser):
continue
tag = self._make_line_tag(bbox) if isinstance(bbox,_BBox) else ""
if parse_method == "manual":
if parse_method in {"manual", "pipeline"}:
sections.append((section, typ, tag))
elif parse_method == "paper":
sections.append((section + tag, typ))
@@ -311,7 +313,7 @@ class DoclingParser(RAGFlowPdfParser):
txt = (text or "").strip()
if not txt:
return []
if parse_method == "manual":
if parse_method in {"manual", "pipeline"}:
return [(txt, DoclingContentType.TEXT.value, "")]
if parse_method == "paper":
return [(txt, DoclingContentType.TEXT.value)]
@@ -455,6 +457,7 @@ class DoclingParser(RAGFlowPdfParser):
docling_server_url: Optional[str] = None,
request_timeout: Optional[int] = None,
):
self.outlines = extract_pdf_outlines(binary if binary is not None else filepath)
if not self.check_installation(docling_server_url=docling_server_url):
raise RuntimeError("Docling not available, please install `docling`")