added EvalDataset Generation
Browse files
app.py
CHANGED
|
@@ -273,7 +273,7 @@ class BSIChatbot:
|
|
| 273 |
all_documents = []
|
| 274 |
|
| 275 |
#print(vectorstore.index_to_docstore_id)
|
| 276 |
-
|
| 277 |
# Iteriere über alle IDs im index_to_docstore_id
|
| 278 |
docs = vectorstore.docstore._dict.values()
|
| 279 |
|
|
@@ -353,7 +353,7 @@ class BSIChatbot:
|
|
| 353 |
f"The Document is: '{chunk.metadata['source']}'\nImage Description is: ':{chunk.page_content}")
|
| 354 |
i = 1
|
| 355 |
for chunk in retrieved_chunks_text:
|
| 356 |
-
|
| 357 |
i = i + 1
|
| 358 |
|
| 359 |
if rerankingStep == True:
|
|
@@ -362,18 +362,18 @@ class BSIChatbot:
|
|
| 362 |
self.initializeRerankingModel()
|
| 363 |
print("Starting Reranking Chunks...")
|
| 364 |
rerankingModel
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
print(retrieved_chunks_text)
|
| 368 |
retrieved_chunks_text = rerankingModel.rerank(query, retrieved_chunks_text, k=15)
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
retrieved_chunks_text = [chunk["content"] for chunk in retrieved_chunks_text]
|
| 373 |
|
| 374 |
i = 1
|
| 375 |
for chunk in retrieved_chunks_text:
|
| 376 |
-
|
| 377 |
i = i + 1
|
| 378 |
|
| 379 |
context = "\nExtracted documents:\n"
|
|
|
|
| 273 |
all_documents = []
|
| 274 |
|
| 275 |
#print(vectorstore.index_to_docstore_id)
|
| 276 |
+
#newprint(vectorstore)
|
| 277 |
# Iteriere über alle IDs im index_to_docstore_id
|
| 278 |
docs = vectorstore.docstore._dict.values()
|
| 279 |
|
|
|
|
| 353 |
f"The Document is: '{chunk.metadata['source']}'\nImage Description is: ':{chunk.page_content}")
|
| 354 |
i = 1
|
| 355 |
for chunk in retrieved_chunks_text:
|
| 356 |
+
#newprint(f"Retrieved Chunk number {i}:\n{chunk}")
|
| 357 |
i = i + 1
|
| 358 |
|
| 359 |
if rerankingStep == True:
|
|
|
|
| 362 |
self.initializeRerankingModel()
|
| 363 |
print("Starting Reranking Chunks...")
|
| 364 |
rerankingModel
|
| 365 |
+
#newprint("DBG:retrieved_chunks_text")
|
| 366 |
+
#newprint(type(retrieved_chunks_text))
|
| 367 |
+
#new print(retrieved_chunks_text)
|
| 368 |
retrieved_chunks_text = rerankingModel.rerank(query, retrieved_chunks_text, k=15)
|
| 369 |
+
#newprint("DBG:retrieved_chunks_text after rerank")
|
| 370 |
+
#newprint(type(retrieved_chunks_text))
|
| 371 |
+
#newprint(retrieved_chunks_text)
|
| 372 |
retrieved_chunks_text = [chunk["content"] for chunk in retrieved_chunks_text]
|
| 373 |
|
| 374 |
i = 1
|
| 375 |
for chunk in retrieved_chunks_text:
|
| 376 |
+
#newprint(f"Reranked Chunk number {i}:\n{chunk}")
|
| 377 |
i = i + 1
|
| 378 |
|
| 379 |
context = "\nExtracted documents:\n"
|