Salesforce

Translate recognized (OCR) text engines

« Go Back
Information
Translate recognized (OCR) text engines
000004215
Public
Product Selection
aiWare - aiWare
Article Details
[API][yes]
[Search][no]
[UI][no]

Recognized (OCR) text is one of the five input formats that translation engines can support. Recognized text is the engine output of a text recognition (OCR) engine.

[Warning] In order to use recognized text translation engines, it is necessary to chain the output of a text recognition engine into the input of the translation engine in one job. The platform will not currently handle this routing for you.

Engine input

Recognized text translation engines should be implemented as segment processing engines. Each segment will be an AION snippet containing recognized text (conforming to the text validation contract).

[Note] The input format is very similar to the input format for extracted text translation engines, so these two types are often supported together in the same engine.

Example input

{
  "schemaId": "https://docs.veritone.com/schemas/vtn-standard/master.json",
  "validationContracts": [
    "text"
  ],
  "series": [
    {
      "startTimeMs": 12000,
      "stopTimeMs": 13000,
      "language": "en",
      "object": {
        "type": "text",
        "text": "the quick brown fox",
        "boundingPoly": [
          {
            "x": 0.1,
            "y": 0.1
          },
          {
            "x": 0.1,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.1
          }
        ]
      }
    },
    {
      "startTimeMs": 13000,
      "stopTimeMs": 14000,
      "language": "en",
      "object": {
        "type": "text",
        "text": "the quick brown fox jumped over the lazy dog",
        "boundingPoly": [
          {
            "x": 0.1,
            "y": 0.1
          },
          {
            "x": 0.1,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.1
          }
        ]
      }
    }
  ]
}
[Note] The language value may or may not be present on the input. If it is not present, the engine may decide whether to try to guess the source language or return an error.

Engine output

Engine output is very similar to the engine input, conforming to the same text validation contract and mirroring the series array and startTimeMs/stopTimeMs values. The only things that usually change are the language code and the values in the text keys.

See the text validation contract json-schema.

Example output

{
  "schemaId": "https://docs.veritone.com/schemas/vtn-standard/master.json",
  "validationContracts": ["text"],
  "series": [
    {
      "startTimeMs": 12000,
      "stopTimeMs": 13000,
      "language": "es",
      "object": {
        "type": "text",
        "text": "el veloz zorro marrón",
        "confidence": 0.99,
        "boundingPoly": [
          {
            "x": 0.1,
            "y": 0.1
          },
          {
            "x": 0.1,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.1
          }
        ]
      }
    },
    {
      "startTimeMs": 13000,
      "stopTimeMs": 14000,
      "language": "es",
      "object": {
        "type": "text",
        "text": "el zorro marrón rápido saltó sobre el perro perezoso",
        "confidence": 0.879,
        "boundingPoly": [
          {
            "x": 0.1,
            "y": 0.1
          },
          {
            "x": 0.1,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.5
          },
          {
            "x": 0.5,
            "y": 0.1
          }
        ]
      }
    }
  ]
}
Additional Technical Documentation Information
Properties
5/7/2024 6:28 PM
5/7/2024 6:28 PM
5/7/2024 6:28 PM
Documentation
Documentation
000004215
Translation Information
English

Powered by