Artificial Intelligence and Machine Learning Discussions
Engage in AI and ML discussions. Collaborate on innovative solutions, explore SAP's AI innovations, and discuss use cases, challenges, and future possibilities.
cancel
Showing results for 
Search instead for 
Did you mean: 

Document Information Extraction with Custom Documents

marcus_schiffer
Active Participant
0 Kudos
2,329

Tutorials: https://developers.sap.com/tutorials/cp-aibus-dox-ui-template-custom.html
--------------------------

Hi,

we have created a Custom template for Document Information Extraction . Now we want to call the service API for this Custom Document. We do not see however, how that would work in the POST/Document service.

When using

{
  "extraction": {
    "headerFields": [
      "Description",
      "Capacity"
    ],
    "lineItemFields": [         
    ]
  },
  "clientId": "c_00",
  "documentType": "Custom",
  "receivedDate": "2020-02-17",
  "enrichment": {
    "sender": {
      "top": 5,
      "type": "businessEntity",
      "subtype": "supplier"
    },
    "employee": {
      "type": "employee"
    }
  }
}

We get this error "message": "Not supported document type: Custom".

What are we doing wrong ? There seems also no option to include the template type in the request.

Any help appreciated.

Regards

Marcus

1 ACCEPTED SOLUTION

Shu_Zhen
Product and Topic Expert
Product and Topic Expert
1,756

Hi Marcus,

When using template for extraction, you need to provide both "schemaId" and "templateId" as input parameters in your payload, as instructed in here:

https://aiservices-trial-dox.cfapps.eu10.hana.ondemand.com/document-information-extraction/v1/

An example payload:

Thank you.

Best regards

Shu Zhen

View solution in original post

8 REPLIES 8

juliana_morais
Product and Topic Expert
Product and Topic Expert
1,756

Hi Marcus,

For the moment, the Template feature and custom document types are only supported on UI application level (not on API level). You'll need to use the Document feature in the UI application to use the template you created as described in the tutorial.

Best regards,

Juliana

0 Kudos
1,756

Hi Juliana,

thanks for clarification. That leaves the service less useful for us since we would need a custom document type. Is there a plan to expose the custom document feature extraction via an API soon?

If you only get the results from the extraction in an UI and need to note them down, what is gained by providing this feature ?

Regards

Marcus

0 Kudos
1,756

Hi Juliana,

Currently I can post a document with templateId and schemaId, my question is that is there any API to retrieve the templateId and schemaId? currently I can get it from UI by debugging.

POST: https://aiservices-trial-dox.cfapps.us10.hana.ondemand.com/document-information-extraction/v1/docume...

{

"clientId": "default",

"documentType": "custom",

"templateId": "87d48a21-3660-48bd-a1c8-cd5ccf286399",

"schemaId": "413f9b87-6b22-4dd7-824b-f9824f6f6639"

}

Best Regards,

Gary

Shu_Zhen
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,756

Hi Gary,

You can retrieve schemaId via running GET document/jobs/{id}, but unfortunately templateId will not be provided there yet.

We may enable this info in the future release for new APIs.

Thanks for the feedback.

Best regards

Shu Zhen

Shu_Zhen
Product and Topic Expert
Product and Topic Expert
1,757

Hi Marcus,

When using template for extraction, you need to provide both "schemaId" and "templateId" as input parameters in your payload, as instructed in here:

https://aiservices-trial-dox.cfapps.eu10.hana.ondemand.com/document-information-extraction/v1/

An example payload:

Thank you.

Best regards

Shu Zhen

0 Kudos
1,756

Hi Shu Zhen,

Where can we find the schemaId and templateId of custom schemas and templates?

Can we use the current state of APIs to process custom documents based on custom schemas and templates?

Best Regards,

Tejaswi

Shu_Zhen
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,756

Hi Tejaswi,

You can run via GET /templates to get a list of templates and associated schemas.

Yes, you can process custom documents.

Best regards

Shu Zhen

0 Kudos
1,756

Hi,

I don't see an endpoint for templates in the API documentation.

https://aiservices-trial-dox.cfapps.eu10.hana.ondemand.com/document-information-extraction/v1/

When do I find the exact service and the endpoint?

And also, I am unable to subscribe to UI service in trial account and as well as enterprise account. Can you please check?

Best Regards,

Tejaswi