support images and tables extract from docx (#4619)

This commit is contained in:
Jyong 2024-05-23 18:05:23 +08:00 • committed by GitHub
commit 233c4150d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 163 additions and 23 deletions

View file

@ -191,9 +191,9 @@ class KnowledgeRetrievalNode(BaseNode):
'title': document.name
}
if segment.answer:
source['content'] = f'question:{segment.content} \nanswer:{segment.answer}'
source['content'] = f'question:{segment.get_sign_content()} \nanswer:{segment.answer}'
else:
source['content'] = segment.content
source['content'] = segment.get_sign_content()
context_list.append(source)
resource_number += 1
return context_list