0

I’m currently having an issue with my code — I’m using the REST API to train a Document AI model with the custom extraction type.

I have already completed the following steps:

  • Called the v1 process API with my PDF file and extracted the page data into a page.json file.

  • Called the API to create a processor of type custom extraction.

  • Called the API to set the dataset.

  • Called the API to update the dataset schema.

Currently, when I call the importDocument API, it returns an error.
When I check the operation using the LRO API, the response status is:

"status": {
  "code": 13,
  "message": "Internal error encountered."
}

I’m not sure what’s wrong with my JSON file.
I’m using the JSON generated from the OCR process, and I’ve added the entities field, which contains the bounding boxes drawn from the frontend.

Here’s an example of my JSON file:

{
  "uri": "gs://.../templates/1/21/1_21_template.pdf",
  "mimeType": "application/pdf",
  "text": "長江紙器(株)(丸長紙器分)\n  .... ",
  "pages": [],
  "shardInfo": {
    "shardCount": "1"
  },
  "entities": [
    {
      "id": "f2fa641c27a18cda",
      "confidence": 1,
      "type": "company_name",
      "mentionText": "長江紙器(株)(丸長紙器分)",
      "pageAnchor": {
        "pageRefs": [
          {
            "page": 0,
            "boundingPoly": {
              "normalizedVertices": [
                { "x": 0.0600458875464684, "y": 0.0622944078947368 },
                { "x": 0.284023582713755, "y": 0.0622944078947368 },
                { "x": 0.284023582713755, "y": 0.0991365131578947 },
                { "x": 0.0600458875464684, "y": 0.0991365131578947 }
              ]
            },
            "layoutType": "VISUAL_ELEMENT"
          }
        ]
      }
    },
    {
      "id": "8e7072d559904372",
      "confidence": 1,
      "type": "ord_id",
      "mentionText": "2334082",
      "pageAnchor": {
        "pageRefs": [
          {
            "page": 0,
            "boundingPoly": {
              "normalizedVertices": [
                { "x": 0.0628339916356877, "y": 0.372820723684211 },
                { "x": 0.110231761152416, "y": 0.372820723684211 },
                { "x": 0.110231761152416, "y": 0.397820723684211 },
                { "x": 0.0628339916356877, "y": 0.397820723684211 }
              ]
            },
            "layoutType": "VISUAL_ELEMENT"
          }
        ]
      }
    }
  ]
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.