mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-01 08:05:07 +08:00
Feat: PDF vision figure parser supports reading context (#12416)
### What problem does this PR solve? PDF vision figure parser supports reading context. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -166,6 +166,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,
|
||||
pdf_parser = Pdf()
|
||||
paper = pdf_parser(filename if not binary else binary,
|
||||
from_page=from_page, to_page=to_page, callback=callback)
|
||||
sections = paper.get("sections", [])
|
||||
else:
|
||||
kwargs.pop("parse_method", None)
|
||||
kwargs.pop("mineru_llm_name", None)
|
||||
@ -192,7 +193,12 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,
|
||||
}
|
||||
|
||||
tbls = paper["tables"]
|
||||
tbls = vision_figure_parser_pdf_wrapper(tbls=tbls, callback=callback, **kwargs)
|
||||
tbls = vision_figure_parser_pdf_wrapper(
|
||||
tbls=tbls,
|
||||
sections=sections,
|
||||
callback=callback,
|
||||
**kwargs,
|
||||
)
|
||||
paper["tables"] = tbls
|
||||
else:
|
||||
raise NotImplementedError("file type not supported yet(pdf supported)")
|
||||
|
||||
Reference in New Issue
Block a user