Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

[FEATURE] 增加对非OpenXML格式的Word文件(.doc)的识别

Open madog1983 opened this issue 9 months ago • 2 comments

功能描述 / Feature Description 增加识别非OpenXML格式的Word文件(.doc)的功能。

解决的问题 / Problem Solved 目前对于word文档的内容识别是使用RapidOCRDocLoader类完成的。然而目前RapidOCRDocLoader类的实现中使用docx库来对文件进行识别,该库只能识别OpenXML格式,也就是.docx格式的文件,对于.doc格式的文件无法进行识别并报错:

2024-05-07 22:40:28,179 - utils.py[line:377] - ERROR: ValueError: 从文件 test/test.doc 加载文档时出错:file 'G:\langchain-chatchat\Langchain-Chatchat\knowledge_base\test\content\test.doc' is not a Word file, content type is 'application/vnd.openxmlformats-officedocument.themeManager+xml'

实现建议 / Implementation Suggestions/document_loaders/mydocloader.py 中增加对word文档格式的判断,并增加对于非OpenXML格式的word文档(.doc)的识别能力。

madog1983 avatar May 07 '24 14:05 madog1983

这个加个读取doc内容,剩下的继续用RapidOCRDocLoader类就行

china-gcg avatar May 13 '24 01:05 china-gcg

@china-gcg 您好,您知道这一块在哪里怎么添加呀!谢谢大佬

git-quanxin avatar May 14 '24 01:05 git-quanxin