View on GitHub

ModernMT Enterprise Edition

Neural Adaptive Machine Translation for professional translators

← Back to Home

API Get Context Vector

Quick example

curl -X GET \
     -H "MMT-ApiKey: <your_api_key>" \
     "" \
     | python -mjson.tool

    "status": 200,
    "data": {
        "source": "en",
        "vectors": {
            "it": "4:1,5:0.042476345"


This method returns the Context Vector containing the best-matching domains and their scores for the provided content. The score is the cosine similarity between the given context, and that domain.

Resource URL


source The language tag of the source language

Example: en
targets The target languages, as a series of comma-separated language tags

Example: it,es
The context text to be analyzed.

Example: Mr President
This parameter can be used to upload and calculate the Context Vector of a large file. In order to do that, Content-Type: multipart/form-data` and X-HTTP-Method-Override: GET headers must be specified and a POST request must be used instead of GET.
While using the "content" parameter, if the content file is compressed you need to specify the compression type. So far only GZIP compression is supported.

Example: gzip
A list containing the Memories to force the use of in this translation.

Example: 1,4

Response Fields

source The source language
vectors An object containing, for each supported target language, the corresponding Context Vector

← Back to Home