Translation

Semantex translation operations

A text translation service.

A text translation service supporting multiple translation engine.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

target
required
string [ 2 .. 5 ] characters

Two letter language code for the target language to translate the source text into.

source
string [ 2 .. 5 ] characters

Two letter language code for the source language. If left blank, the model will try to infer the language.

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

engine
string

The generative model to use.

Enum: "genai" "deepl"
object

Configuration for the genai model.

object

Configuration for the DeepL model.

Responses
200

200 response

post/text/translate
Request samples
application/json
{
  • "text": "Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus.",
  • "target": "fr"
}
Response samples
application/json
{ }

A classifier that measures the accuracy of the translated text.

Given a text pair [text1, text2], the classifier outputs 't' if the translation is faithful and accurate, 'f' otherwise.

Securityapi_key
Request
Request Body schema: application/json
required
text1
required
string non-empty

The text content with UTF-8 text representation

text2
required
string non-empty

The text content with UTF-8 text representation

lang1
string [ 2 .. 5 ] characters

The language code for the text1.

lang2
string [ 2 .. 5 ] characters

The language code for the text2.

string or string
Default: "general"

The content domain to be used for additional context.

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

explain
boolean
Default: false

A boolean flag that should be set to true if an explanation for the label is required.

cache
boolean
Default: true

A boolean flag that utilizes a simple caching scheme as an optimization for duplicates in input..

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/translate/accuracy
Request samples
application/json
{
  • "text1": "You owe me 200 dollars, and I am here till today.",
  • "text2": "Vous me devez 200 dollars, et je suis là jusqu'à aujourd'hui.",
  • "explain": true
}
Response samples
application/json
{ }