Fix: fix pdf_parser ignored in rag/app/naive.py (#11065)

### What problem does this PR solve?

Fix: fix pdf_parser ignored in rag/app/naive.py #11000

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Billy Bao
2025-11-06 15:20:35 +08:00
committed by GitHub
parent ca30ef83bf
commit 4b8ce08050
6 changed files with 26 additions and 25 deletions

View File

@ -25,7 +25,7 @@ from rag.nlp import bullets_category, remove_contents_table, \
make_colon_as_title, tokenize_chunks, docx_question_level, tree_merge
from rag.nlp import rag_tokenizer, Node
from deepdoc.parser import PdfParser, DocxParser, HtmlParser
from rag.app.naive import plaintext_parser, PARSERS
from rag.app.naive import by_plaintext, PARSERS
@ -161,10 +161,10 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,
layout_recognizer = "DeepDOC" if layout_recognizer else "Plain Text"
name = layout_recognizer.strip().lower()
parser = PARSERS.get(name, plaintext_parser)
parser = PARSERS.get(name, by_plaintext)
callback(0.1, "Start to parse.")
raw_sections, tables, _ = parser(
raw_sections, tables, pdf_parser = parser(
filename = filename,
binary = binary,
from_page = from_page,