-
Notifications
You must be signed in to change notification settings - Fork 2
Bergamot REST API
Ulrich Germann edited this page Mar 12, 2020
·
1 revision
-
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 (defaulttext
) -
options
: name of the field in JSON objects that contian translation parameters (defaultoptions
)
-
-
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 thepayload
option specifies) is replaced recursively by these rules.
This allows to submit a tree structure as a translation request.