Update utils.py
Browse files
utils.py
CHANGED
@@ -565,6 +565,11 @@ def extract_document_info(documents):
|
|
565 |
download_link = f"https://huggingface.co/spaces/alexkueck/SucheRAG/resolve/main/chroma/kkg/word/{title}"
|
566 |
else:
|
567 |
download_link = doc_path
|
|
|
|
|
|
|
|
|
|
|
568 |
|
569 |
info = {
|
570 |
'content': doc.page_content,
|
@@ -573,7 +578,7 @@ def extract_document_info(documents):
|
|
573 |
'seite': doc.metadata.get("page", "Unbekannte Seite"),
|
574 |
'pfad': doc_path,
|
575 |
'download_link': download_link,
|
576 |
-
'id':
|
577 |
}
|
578 |
extracted_info.append(info)
|
579 |
return extracted_info
|
|
|
565 |
download_link = f"https://huggingface.co/spaces/alexkueck/SucheRAG/resolve/main/chroma/kkg/word/{title}"
|
566 |
else:
|
567 |
download_link = doc_path
|
568 |
+
|
569 |
+
if doc.doc_id:
|
570 |
+
id = doc.doc_id
|
571 |
+
else:
|
572 |
+
id = None
|
573 |
|
574 |
info = {
|
575 |
'content': doc.page_content,
|
|
|
578 |
'seite': doc.metadata.get("page", "Unbekannte Seite"),
|
579 |
'pfad': doc_path,
|
580 |
'download_link': download_link,
|
581 |
+
'id': id
|
582 |
}
|
583 |
extracted_info.append(info)
|
584 |
return extracted_info
|