Skip to main content

Task type: embeddings

The text2vec task type is used to convert text into a vector representation. Takes text as input and returns an array of numbers, which is called an embedding.

System name: text2vec

List of services

Data types

Predict request

  • Specification
  • Python type: mlp_sdk.types.Text (the mlp-python-sdk module)
  • Java type: com.mlp.api.datatypes.nlp.Text (the mlp-datatypes module)

Request example:

{
"text": "Text to be processed"
}

Predict response

  • Specification
  • Python type: mlp_sdk.types.Vector (the mlp-python-sdk module)
  • Java type: com.mlp.api.datatypes.nlp.Vector (the mlp-datatypes module)

The response can contain an arbitrary JSON object.

{
"vector": [
0.044618092477321625,
-0.0005380399525165558,
0.04815515875816345,
0.03943399339914322,
-0.06751369684934616,
-0.353855162858963,
0.08526383340358734,
0.06718949973583221
]
}