Update utils.py
Browse files
utils.py
CHANGED
@@ -344,8 +344,7 @@ def document_loading_splitting():
|
|
344 |
#alle zusammen in docs...
|
345 |
docs.extend(pdf_documents)
|
346 |
docs.extend(word_documents)
|
347 |
-
|
348 |
-
print("docs???..........."+str(doc.metadata["title"]))
|
349 |
#andere loader...
|
350 |
# Load PDF
|
351 |
#loader = PyPDFLoader(PDF_URL)
|
@@ -540,7 +539,7 @@ def rag_chain_simpel( prompt, retriever):
|
|
540 |
|
541 |
#passend zum Prompt relevante Dokuemnte raussuchen
|
542 |
relevant_docs = retriever.invoke(prompt)
|
543 |
-
|
544 |
#zu jedem relevanten Dokument die wichtigen Informationen zusammenstellen (im Dict)
|
545 |
extracted_docs = extract_document_info(relevant_docs)
|
546 |
|
@@ -581,7 +580,6 @@ def rag_chain_simpel( prompt, retriever):
|
|
581 |
def extract_document_info(documents):
|
582 |
extracted_info = []
|
583 |
for doc in documents:
|
584 |
-
print("extracted_doc_info........................"+str(doc))
|
585 |
# Extract the filename from the path to use as the title
|
586 |
filename = os.path.basename(doc.metadata.get("path", ""))
|
587 |
title = filename if filename else "Keine Überschrift"
|
|
|
344 |
#alle zusammen in docs...
|
345 |
docs.extend(pdf_documents)
|
346 |
docs.extend(word_documents)
|
347 |
+
|
|
|
348 |
#andere loader...
|
349 |
# Load PDF
|
350 |
#loader = PyPDFLoader(PDF_URL)
|
|
|
539 |
|
540 |
#passend zum Prompt relevante Dokuemnte raussuchen
|
541 |
relevant_docs = retriever.invoke(prompt)
|
542 |
+
|
543 |
#zu jedem relevanten Dokument die wichtigen Informationen zusammenstellen (im Dict)
|
544 |
extracted_docs = extract_document_info(relevant_docs)
|
545 |
|
|
|
580 |
def extract_document_info(documents):
|
581 |
extracted_info = []
|
582 |
for doc in documents:
|
|
|
583 |
# Extract the filename from the path to use as the title
|
584 |
filename = os.path.basename(doc.metadata.get("path", ""))
|
585 |
title = filename if filename else "Keine Überschrift"
|