Text Transformers

Semantex text transformers operations' request on provided content

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
{ }

Content Embeddings

Rich content (Paragraphs, sentences, phrases) embedding representation.

Securityapi_key
Request
Request Body schema: application/json
required
texts
required
Array of strings [ 1 .. 50 ] items unique

An array of text content objects in UTF-8 text representation

Responses
200

200 response

post/text/transform/embeddings
Request samples
application/json
{
  • "texts": [
    ]
}
Response samples
application/json
{ }

Text Split

Split the English text content into multiple sentences. Recommend for short text content.

Securityapi_key
Request
query Parameters
lang
required
string

The two letter language code

Example: lang=en
text
required
string

The text content with UTF-8 text representation

Example: text=I am going to the mall and I will be there for a while. Do you want something from Dr. Smith's office?
Responses
200

200 response

400

Invalid request body

403

The request is forbidden (Please input a valid API key)

get/text/transform/sentences
Request samples
Response samples
application/json
{
  • "status": {
    },
  • "result": {
    }
}

Text Split

Split the English text content into multiple sentences. Recommend for long text content.

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

The text content with UTF-8 text representation

lang
required
string

The two letter language code (English only)

Enum: "en" "EN"
Responses
200

200 response

400

Invalid request body

403

The request is forbidden (Please input a valid API key)

post/text/transform/sentences
Request samples
application/json
{
  • "text": "I am going to the mall and I will be there for a while. Do you want something from Dr. Smith's office?",
  • "lang": "en"
}
Response samples
application/json
{
  • "status": {
    },
  • "result": {
    }
}

Multilingual Text Translation (EXPERIMENTAL)

Perform text translation to and from any core languages.

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.

ishtml
boolean
Default: false

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

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/translation
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
{ }