Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,7 +123,7 @@ def ask_question(question):
|
|
| 123 |
"context": "..." + answer["context"] + "...",
|
| 124 |
"answer": answer["answer"],
|
| 125 |
"relevance": round(answer["score"] * 100, 2),
|
| 126 |
-
"document": [doc for doc in
|
| 127 |
# "_raw": answer,
|
| 128 |
"offset_start_in_doc": answer["offsets_in_document"][0]["start"],
|
| 129 |
}
|
|
|
|
| 123 |
"context": "..." + answer["context"] + "...",
|
| 124 |
"answer": answer["answer"],
|
| 125 |
"relevance": round(answer["score"] * 100, 2),
|
| 126 |
+
"document": [doc for doc in prediction["documents"] if doc["id"] == answer["document_id"]][0],
|
| 127 |
# "_raw": answer,
|
| 128 |
"offset_start_in_doc": answer["offsets_in_document"][0]["start"],
|
| 129 |
}
|