Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page Properties
hiddentrue
idrLANGDONE

Product Version
Report Note
Assignee

Resources & Remarks


Modification History

NameDateProduct VersionAction
Antje15 JUL 20212021 Autumncreated


...

As of Versionproduct version 2021 Autumn | component version 0.3
Request MethodGET
Response FormatJSON
Description


Excerpt

Sends a feedback to the ML Pipeline informing about the user decision for one of the property values suggested in a prediction.


After metadata extraction is done and predicted property values are shown to the user, the user decides on the validity of those data by accepting them or changing shown values. It is important to inform ML Pipeline about this decision in order to improve future predictions by calling this feedback endpoint.

In the JSON request body, following parameters are expected:

  • predictionId - ID returned by the classification retrieval endpoints.
  • feedbackData - values for all properties the user could modify after retrieving the prediction (e.g. aiInvoiceNumber, aiCompanyName, aiAmount, aiIssuedDate):
    • value - value selected/entered by user
    • boundingBox  - optional, coordinates of selected value on the page within the binary content file
    • page - optional, page number where value was found within the binary content file
HTTP Status CodeDescription
200 OKFeedback is logged successfully.
400 Bad RequestRequest is bad.
404 Not FoundSpecified predictionId is not found.
500 Internal Server ErrorError while storing feedback.

If an error is thrown, it will be a JSON structure returned as response body.

Request Header

Content-Type: application/json

X-ID-TENANT-NAME: tenant_name

Request Example
/predict-api/predict/extraction/feedback
Code Block
languageyml
titlerequest body
{
    "properties": {
        "predictionId": {
            "value":474
        },
        "feedbackData": [
            {
                "propertyName": "aiInvoiceNumber",
                "value": "RWTÜV",
                "boundingBox":[123, 222, 33, 14],
                "page": 1
            },
            {
                "propertyName": "aiCompanyName",
                "value": "CompanyName"
            },
            {
                "propertyName": "aiAmount",
                "value": "234.44"
            },
            {
                "propertyName": "aiIssuedDate",
                "value": "10.4.2020"
            }
        ]
    }
}

Result Example

(1) Successful

200 OK

(2) Not succelful:

400 Bad Request

Code Block
languageyml
titleresponse body
{
    "statusCode": 400,
    "timestamp": "2020-12-25T09:42:33.386+00:00",
    "message": "JSON parse error: Unrecognized field \"aiCompanssyName\" (class com.os.ai.predict.domain.extraction.ExtractionFeedbackRequestData), not marked as ignorable..."
}

...