Scorer API
API endpoints, version 0 (version not set)
Download OpenAPI specification:Download
Endpoints previously implemented in docai-scorer.
Place a request to score a document
Authorizations:
access_token
path Parameters
id required | string Model ID. Currently only 1 model with ID "main" is supported |
Request Body schema: multipart/form-data
documentGuid | string Document guid |
document required | string <binary> Document to score |
Responses
Response samples
- 202
Content type
application/json
{- "jobId": "38ce1872-30dc-11ec-a351-acde48001122",
}
Score a document stored in a remote location
Authorizations:
access_token
path Parameters
id required | string Model ID |
Request Body schema: application/json
inputKey required | string |
inputBucket required | string |
outputKey required | string |
outputBucket required | string |
imageKey required | string |
imageBucket required | string |
logKey required | string |
logBucket required | string |
extra | string |
documentGuid | string |
Responses
Request samples
- Payload
Content type
application/json
{- "inputKey": "string",
- "inputBucket": "string",
- "outputKey": "string",
- "outputBucket": "string",
- "imageKey": "string",
- "imageBucket": "string",
- "logKey": "string",
- "logBucket": "string",
- "extra": "string",
- "documentGuid": "string"
}
Information about a finished job
Authorizations:
access_token
path Parameters
id required | string Job ID obtained from an async call |
Responses
Response samples
- 200
Content type
application/json
{- "documentGuid": "file_8f00870c-6ed8-4cd7-5864-08d7dc0e99e2",
- "entities": [
- {
- "pageIndex": "0",
- "dpiX": 200,
- "entityId": "f6a142f6-e438-4ca5-b117-ceacc4695f28",
- "sLabel": "DoBValue",
- "sValue": "03/26/2016",
- "labelConfidence": 0.6921263933181763,
- "rzRect": {
- "bx": 236.66666666666666,
- "by": 990,
- "ex": 430,
- "ey": 962
}, - "rectImg": "(imgBase64)"
}, - "..."
], - "pages": {
- "0": {
- "pageClass": "advertisement",
- "classConfidence": 0.15744306375191164
}
}, - "entityConfidences": [
- {
- "entityClass": "DoBValue",
- "topEntities": [
- {
- "entityValue": "03/26/2016",
- "entityConfidence": 0.6921263933181763,
- "entityId": "f6a142f6-e438-4ca5-b117-ceacc4695f28"
}, - {
- "entityValue": "3/26/2016",
- "entityConfidence": 0.7135215997695923,
- "entityId": "933e4c41-a209-4600-8dbe-6b83f170f4f0"
}
]
}, - "..."
]
}
Return list of registered pipelines in given project
Authorizations:
access_token
query Parameters
projectId required | string |
includeDeleted | boolean |
Responses
Response samples
- 200
Content type
application/json
[- {
- "name": "dev",
- "modelMetadata": {
- "version": "26accf"
}, - "status": "Running",
- "statusMessage": "status message",
- "preSleepingState": "Running"
}, - "..."
]
Updates an existing pipeline
Authorizations:
access_token
path Parameters
id required | string Pipeline ID |
Request Body schema: application/json
Pipeline definition
affinity | object |
required | object (Autoscaler) |
customPostProcessor required | string |
customPipeline required | boolean |
muteOutput required | boolean |
name required | string |
nodeSelector | object |
pipelineConfig required | string |
required | object (Resources) |
Array of objects (Tolerations) | |
workspaceId required | string |
builtinPostProcessor | string Enum: "generic" "supply-chain" |
Responses
Request samples
- Payload
Content type
application/json
{- "affinity": { },
- "autoscaler": {
- "maxReplicas": 4,
- "minReplicas": 1
}, - "customPostProcessor": "",
- "customPipeline": false,
- "muteOutput": false,
- "name": "pipe-99",
- "nodeSelector": { },
- "pipelineConfig": "spec:\n pipeline:\n steps:\n - tasks:\n - name: Intake\n type: PipelineTask\n class: argus.processors.ocr_processors.Intake\n parameters:\n root_docs_path: /input_files\n follow_symlinks: true\n - tasks:\n - name: PdfExtract\n type: PipelineTask\n class: argus.processors.ocr_processors.PdfTextExtract\n - tasks:\n - name: ImageNormalize\n class: argus.processors.ocr_processors.NormalizeImages\n parameters:\n resample_to_dpi: 300\n normalize_image_format: .jpg\n - tasks:\n - name: OCR\n class: argus.processors.ocr_processors.GenericOcr\n parameters:\n ocr_style: BestTextExtract\n - tasks:\n - name: Predict\n class: argus.processors.train_eval_processors.TrainEvalProcessor\n parameters:\n artifacts:\n base_model_name_or_path: {{ .labellingModelName }}\n - tasks:\n - name: Predict\n class: argus.processors.train_eval_processors.TrainEvalProcessor\n parameters:\n artifacts:\n base_model_name_or_path: {{ .classificationModelName }}\n - tasks:\n - name: PostProcess\n class: argus.processors.post_processors.generic_post_processor.PostProcessor\n parameters:\n output_format: json\n labeling_threshold: 0.8\n output_annoset_format:\n options: { }\n write_all_steps: false\n cache_processors: true\n artifacts:\n - version: \"\"\n source: http://mock-model-registry-service.default.svc.cluster.local:8080/{{ .labellingModelName }}:download\n name: {{ .labellingModelName }}\n - version: \"\"\n source: http://mock-model-registry-service.default.svc.cluster.local:8080/{{ .classificationModelName }}:download\n name: {{ .classificationModelName }}\n",
- "resources": {
- "requests": {
- "cpu": "500m",
- "memory": "2G"
}, - "limits": {
- "cpu": "4",
- "memory": "6G"
}
}, - "tolerations": [
- {
- "effect": "NoExecute",
- "key": "key1",
- "operator": "Equal",
- "value": "string",
- "tolerationSeconds": 3600
}
], - "workspaceId": "string",
- "builtinPostProcessor": "generic"
}
Response samples
- 200
Content type
application/json
{- "name": "pipeline-name",
}
Feedback
- Submit and view feedback for this page
- Send feedback about H2O Document AI to cloud-feedback@h2o.ai