Skip to content

Bergamot REST API

Ulrich Germann edited this page Mar 12, 2020 · 1 revision

Bergamot REST API

  • POST a json blob to marian server:/api/bergamot/v1

  • POST parameters:

    • payload: name of the field in JSON objects that contain the translation payload (default text)
    • options: name of the field in JSON objects that contian translation parameters (default options)
  • translation parameters (in the field named as specified by the options parameter above)

    • inputFormat:
      • sentence: one sentence per line
      • paragraph: one paragraph, paragraph will be automatically sentence-split
      • wrapped_text: paragraphs delimited by empty line, newline between non-empty lines are replaced by space; automatic sentence splitting for each paragraph

The outermost JSON entity must be an object with the two fields as specified by the payload and options parameters above. The value of the payload field is processed as follows:

  • if it is a string, it is replaced by the Translation
  • if it is an array, each element in the array is processed recursively by these rules
  • if it is an object, the text field (or whatever the payload option specifies) is replaced recursively by these rules.

This allows to submit a tree structure as a translation request.

Clone this wiki locally