mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-24 21:48:52 +00:00
docs: Add info where the feedback is stored (#3772)
* Add info where the feedback is stored * Fix misplaced line breaks * Generate OpenAPI Specs * Generate OpenAPI Specs * Apply black * Generate OpenAPI specs * Add missing whitespace Co-authored-by: bogdankostic <bogdankostic@web.de>
This commit is contained in:
parent
86ade4817e
commit
b8fff837b4
@ -98,7 +98,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Get Feedback",
|
||||
"description": "This endpoint allows the API user to retrieve all the feedback that has been submitted\nthrough the `POST /feedback` endpoint.",
|
||||
"description": "This endpoint allows the API user to retrieve all the feedback that has been submitted through the `POST /feedback` endpoint.",
|
||||
"operationId": "get_feedback",
|
||||
"responses": {
|
||||
"200": {
|
||||
@ -122,7 +122,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Post Feedback",
|
||||
"description": "This endpoint allows the API user to submit feedback on an answer for a particular query.\n\nFor example, the user can send feedback on whether the answer was correct and\nwhether the right snippet was identified as the answer.\n\nInformation submitted through this endpoint is used to train the underlying QA model.",
|
||||
"description": "With this endpoint, the API user can submit their feedback on an answer for a particular query. This feedback is then written to the label_index of the DocumentStore.\n\nFor example, the user can send feedback on whether the answer was correct and whether the right snippet was identified as the answer.\n\nInformation submitted through this endpoint is used to train the underlying QA model.",
|
||||
"operationId": "post_feedback",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
@ -160,7 +160,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Delete Feedback",
|
||||
"description": "This endpoint allows the API user to delete all the\nfeedback that has been sumbitted through the\n`POST /feedback` endpoint",
|
||||
"description": "This endpoint allows the API user to delete all the feedback that has been sumbitted through the\n`POST /feedback` endpoint.",
|
||||
"operationId": "delete_feedback",
|
||||
"responses": {
|
||||
"200": {
|
||||
@ -180,7 +180,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Get Feedback Metrics",
|
||||
"description": "This endpoint returns basic accuracy metrics based on user feedback,\ne.g., the ratio of correct answers or correctly identified documents.\nYou can filter the output by document or label.\n\nExample:\n\n`curl --location --request POST 'http://127.0.0.1:8000/eval-doc-qa-feedback' --header 'Content-Type: application/json' --data-raw '{ \"filters\": {\"document_id\": [\"XRR3xnEBCYVTkbTystOB\"]} }'`",
|
||||
"description": "This endpoint returns basic accuracy metrics based on user feedback, for example, the ratio of correct answers or correctly identified documents.\nYou can filter the output by document or label.\n\nExample:\n\n`curl --location --request POST 'http://127.0.0.1:8000/eval-doc-qa-feedback' --header 'Content-Type: application/json' --data-raw '{ \"filters\": {\"document_id\": [\"XRR3xnEBCYVTkbTystOB\"]} }'`",
|
||||
"operationId": "get_feedback_metrics",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
@ -219,7 +219,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Export Feedback",
|
||||
"description": "This endpoint returns JSON output in the SQuAD format for question/answer pairs\nthat were marked as \"relevant\" by user feedback through the `POST /feedback` endpoint.\n\nThe context_size param can be used to limit response size for large documents.",
|
||||
"description": "This endpoint returns JSON output in the SQuAD format for question/answer pairs that were marked as \"relevant\" by user feedback through the `POST /feedback` endpoint.\n\nThe context_size param can be used to limit response size for large documents.",
|
||||
"operationId": "export_feedback",
|
||||
"parameters": [
|
||||
{
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Get Feedback",
|
||||
"description": "This endpoint allows the API user to retrieve all the feedback that has been submitted\nthrough the `POST /feedback` endpoint.",
|
||||
"description": "This endpoint allows the API user to retrieve all the feedback that has been submitted through the `POST /feedback` endpoint.",
|
||||
"operationId": "get_feedback",
|
||||
"responses": {
|
||||
"200": {
|
||||
@ -122,7 +122,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Post Feedback",
|
||||
"description": "This endpoint allows the API user to submit feedback on an answer for a particular query.\n\nFor example, the user can send feedback on whether the answer was correct and\nwhether the right snippet was identified as the answer.\n\nInformation submitted through this endpoint is used to train the underlying QA model.",
|
||||
"description": "With this endpoint, the API user can submit their feedback on an answer for a particular query. This feedback is then written to the label_index of the DocumentStore.\n\nFor example, the user can send feedback on whether the answer was correct and whether the right snippet was identified as the answer.\n\nInformation submitted through this endpoint is used to train the underlying QA model.",
|
||||
"operationId": "post_feedback",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
@ -160,7 +160,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Delete Feedback",
|
||||
"description": "This endpoint allows the API user to delete all the\nfeedback that has been sumbitted through the\n`POST /feedback` endpoint",
|
||||
"description": "This endpoint allows the API user to delete all the feedback that has been sumbitted through the\n`POST /feedback` endpoint.",
|
||||
"operationId": "delete_feedback",
|
||||
"responses": {
|
||||
"200": {
|
||||
@ -180,7 +180,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Get Feedback Metrics",
|
||||
"description": "This endpoint returns basic accuracy metrics based on user feedback,\ne.g., the ratio of correct answers or correctly identified documents.\nYou can filter the output by document or label.\n\nExample:\n\n`curl --location --request POST 'http://127.0.0.1:8000/eval-doc-qa-feedback' --header 'Content-Type: application/json' --data-raw '{ \"filters\": {\"document_id\": [\"XRR3xnEBCYVTkbTystOB\"]} }'`",
|
||||
"description": "This endpoint returns basic accuracy metrics based on user feedback, for example, the ratio of correct answers or correctly identified documents.\nYou can filter the output by document or label.\n\nExample:\n\n`curl --location --request POST 'http://127.0.0.1:8000/eval-doc-qa-feedback' --header 'Content-Type: application/json' --data-raw '{ \"filters\": {\"document_id\": [\"XRR3xnEBCYVTkbTystOB\"]} }'`",
|
||||
"operationId": "get_feedback_metrics",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
@ -219,7 +219,7 @@
|
||||
"feedback"
|
||||
],
|
||||
"summary": "Export Feedback",
|
||||
"description": "This endpoint returns JSON output in the SQuAD format for question/answer pairs\nthat were marked as \"relevant\" by user feedback through the `POST /feedback` endpoint.\n\nThe context_size param can be used to limit response size for large documents.",
|
||||
"description": "This endpoint returns JSON output in the SQuAD format for question/answer pairs that were marked as \"relevant\" by user feedback through the `POST /feedback` endpoint.\n\nThe context_size param can be used to limit response size for large documents.",
|
||||
"operationId": "export_feedback",
|
||||
"parameters": [
|
||||
{
|
||||
|
||||
@ -20,10 +20,9 @@ document_store: BaseDocumentStore = get_pipelines().get("document_store", None)
|
||||
@router.post("/feedback")
|
||||
def post_feedback(feedback: CreateLabelSerialized):
|
||||
"""
|
||||
This endpoint allows the API user to submit feedback on an answer for a particular query.
|
||||
With this endpoint, the API user can submit their feedback on an answer for a particular query. This feedback is then written to the label_index of the DocumentStore.
|
||||
|
||||
For example, the user can send feedback on whether the answer was correct and
|
||||
whether the right snippet was identified as the answer.
|
||||
For example, the user can send feedback on whether the answer was correct and whether the right snippet was identified as the answer.
|
||||
|
||||
Information submitted through this endpoint is used to train the underlying QA model.
|
||||
"""
|
||||
@ -38,8 +37,7 @@ def post_feedback(feedback: CreateLabelSerialized):
|
||||
@router.get("/feedback", response_model=List[Label])
|
||||
def get_feedback():
|
||||
"""
|
||||
This endpoint allows the API user to retrieve all the feedback that has been submitted
|
||||
through the `POST /feedback` endpoint.
|
||||
This endpoint allows the API user to retrieve all the feedback that has been submitted through the `POST /feedback` endpoint.
|
||||
"""
|
||||
labels = document_store.get_all_labels()
|
||||
return labels
|
||||
@ -48,9 +46,8 @@ def get_feedback():
|
||||
@router.delete("/feedback")
|
||||
def delete_feedback():
|
||||
"""
|
||||
This endpoint allows the API user to delete all the
|
||||
feedback that has been sumbitted through the
|
||||
`POST /feedback` endpoint
|
||||
This endpoint allows the API user to delete all the feedback that has been sumbitted through the
|
||||
`POST /feedback` endpoint.
|
||||
"""
|
||||
all_labels = document_store.get_all_labels()
|
||||
user_label_ids = [label.id for label in all_labels if label.origin == "user-feedback"]
|
||||
@ -60,8 +57,7 @@ def delete_feedback():
|
||||
@router.post("/eval-feedback")
|
||||
def get_feedback_metrics(filters: Optional[FilterRequest] = None):
|
||||
"""
|
||||
This endpoint returns basic accuracy metrics based on user feedback,
|
||||
e.g., the ratio of correct answers or correctly identified documents.
|
||||
This endpoint returns basic accuracy metrics based on user feedback, for example, the ratio of correct answers or correctly identified documents.
|
||||
You can filter the output by document or label.
|
||||
|
||||
Example:
|
||||
@ -98,8 +94,7 @@ def export_feedback(
|
||||
context_size: int = 100_000, full_document_context: bool = True, only_positive_labels: bool = False
|
||||
):
|
||||
"""
|
||||
This endpoint returns JSON output in the SQuAD format for question/answer pairs
|
||||
that were marked as "relevant" by user feedback through the `POST /feedback` endpoint.
|
||||
This endpoint returns JSON output in the SQuAD format for question/answer pairs that were marked as "relevant" by user feedback through the `POST /feedback` endpoint.
|
||||
|
||||
The context_size param can be used to limit response size for large documents.
|
||||
"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user