Spaces:
Runtime error
Runtime error
Adrien
commited on
Commit
·
9a276ad
1
Parent(s):
c56c0fd
feat: add chunk part with answer
Browse files
rag_demo/rag/source_annotator.py
CHANGED
|
@@ -31,7 +31,7 @@ class SourceAnnotator:
|
|
| 31 |
# Could also use a score cut-off instead of max()
|
| 32 |
max_score = max(scores, key=lambda x: x["score"])
|
| 33 |
|
| 34 |
-
annotated_response += f"{sentence} [filename: {max_score['filename']}, chunk_id: {max_score['chunk_id']}] "
|
| 35 |
|
| 36 |
return annotated_response
|
| 37 |
|
|
|
|
| 31 |
# Could also use a score cut-off instead of max()
|
| 32 |
max_score = max(scores, key=lambda x: x["score"])
|
| 33 |
|
| 34 |
+
annotated_response += f"{sentence} [filename: {max_score['filename']}, chunk_id: {max_score['chunk_id']}, chunk_part_with_answer: {max_score['answer']}] "
|
| 35 |
|
| 36 |
return annotated_response
|
| 37 |
|