KAG icon indicating copy to clipboard operation
KAG copied to clipboard

[Bug] [docx文档解析] DocxReader的Chunk结果不全

Open unrealise opened this issue 8 months ago • 0 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

Operating system information

Linux

What happened

DocxReader的Chunk结果只有头尾,中间绝大部分丢失

Image

经调试是“正文”格式的heading_level=10,没有进入应该进入的处理分支,修改分支条件(如下图)后Chunk结果基本完整,但丢失了最后一个Chunk的内容,读取另一个文档时又出现其它问题。

Image

缺陷分析:_build_document_tree的【Handle different types of paragraphs】过程对于内容层级排版的多样性和不规范性的兼容性不够,存在格式与语义冲突的情况 改进建议: 对常见领域的文档做针对性强的Reader,不必一味追求通用,可以将xml格式内容与正则匹配结合以适应格式与语义冲突的情况

How to reproduce

文档来自网上下载的《中华人民共和国政府采购法》和《中华人民共和国政府采购法实施条例》

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

unrealise avatar Apr 25 '25 07:04 unrealise