Langchain-Chatchat
Langchain-Chatchat copied to clipboard
[FEATURE] 增加对非OpenXML格式的Word文件(.doc)的识别
功能描述 / 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)的识别能力。
这个加个读取doc内容,剩下的继续用RapidOCRDocLoader类就行
@china-gcg 您好,您知道这一块在哪里怎么添加呀!谢谢大佬