How to translate from English to Dutch with e-Translation and e-Terminology

Introduction

The tutorial demonstrates usage of e-Translation and how to use more features to improve translation quality.

Use e-Terminology before e-Translation to improve or adjust translated output. e-Terminology identifies terms within the source text and helps machine translation to use them. You can introduce your own terminology collection to force MT to use your terminology in the term.tilde.com portal.

Quick links

  1. Technical Instructions
  2. Try out API Calls
  3. Using Pipelines - alternative approach
  4. Customising e-Translation
    1. Selecting translation system
    2. ITS 2.0 category support
    3. List of systems
    4. Private systems

Technical Instructions

Step 1 - using e-Terminology

Annotate terms within the source text.

cURL

curl -X POST -d "The EU in brief. The EU is a unique economic and political partnership between 28 European countries that together cover much of the continent." "https://api.freme-project.eu/current/e-terminology/tilde?informat=text&outformat=json-ld&source-lang=en&target-lang=nl"

Result

The following terms are found (term rank in brackets): continent [1], partnership [0.8961], briefing [0.5946], economics [0.3165], covering [0]

Step 2 - using e-Translation to translate

Translate text taking into account the annotated term in Step 1.

The input data is the output of Step 1

cURL

curl -X POST -d @response-of-step1.json --header "Content-Type: applicatio/json+ld" --header "Accept: application/json+ld" "https://api.freme-project.eu/current/e-translation/tilde?informat=json-ld&outformat=json-ld&source-lang=en&target-lang=nl"   

Where the file response-of-step1.json is the response of e-Terminology.

Result

The result of machine translation is: De voorschriften in DE EU. De EU is een uniek partnerschap tussen politiek en economie in de Europese landen, die gezamenlijk 28 verpakking van het continent.
With MT confidence score 0.66955627717300892

Try out API Calls

For demonstration purposes, we included an API call to /e-terminology/tilde and /e-translation/tilde. This tutorial covers only the most important parameters of this API endpoint. You can find an extensive overview on this API call in the complete API documentation.

Request

Query string parameter input
Specify the text you want to translate here.


Query string parameter source-lang
Enter the language you want to translate from.


Query string parameter source-lang
Enter the language you want to translate to.


Query string parameter informat.
Specifies the format of the input data. In this example, we submit plaintext, so we set this parameter to "text".


Query string parameter outformat
Specifies the format of the data returned by FREME. In this example, we want to return JSON-LD data that can be easily processed by many programming languages, so we specify outformat=json-ld


Response

Response of Step 1: e-Terminology

Here you will get the intermediate results from e-Terminology, which will be submitted to e-Translation.

Response of Step 2: e-Translation

Here you will get the results from e-Translation.

Using Pipeline - alternative approach

Query e-services with a single API call

Instead of querying the FREME server in two steps, you can also use pipeline to force chaining of the services on the server side. Follow the pipelining tutorial for more information.

cURL

curl -X POST -H "Content-Type: application/json" -d "[
{
\"method\": \"POST\",
\"endpoint\": \"https://api.freme-project.eu/current/e-terminology/tilde\",
\"parameters\": {
\"source-lang\": \"en\",
\"target-lang\": \"nl\"
},
\"headers\": {
\"content-type\": \"text/plain\",
\"accept\": \"application/json+ld\"
},
\"body\": \"The EU in brief. The EU is a unique economic and political partnership between 28 European countries that together cover much of the continent.\"
},
{
\"method\": \"POST\",
\"endpoint\": \"https://api.freme-project.eu/current/e-translation/tilde\",
\"parameters\": {
\"source-lang\": \"en\",
\"target-lang\": \"nl\"
},
\"headers\": {
\"content-type\": \"application/json+ld\",
\"accept\": \"application/json+ld\"
}
}
]
" "https://api.freme-project.eu/current/pipelining/chain"
        

Result

The results from both services are in the output (same as in Step 2 - using e-Translation to translate):

The following terms are found (term rank in brackets): continent [1], partnership [0.8961], briefing [0.5946], economics [0.3165], covering [0]

The result of machine translation is: De voorschriften in DE EU. De EU is een uniek partnerschap tussen politiek en economie in de Europese landen, die gezamenlijk 28 verpakking van het continent.
With MT confidence score 0.66955627717300892

Use of SPARQL filters

Sometimes there is no need for complex RDF data structures. If so, then you can also retrieve a predefined structure of data using the SPARQL filtering possibilities of the FREME server. See more about this feature here: this article

SPARQL filters can be used together with pipelines. Firstly, you must find the existing filter or create a new one and then add the filter name as a parameter to the pipeline configuration.

Customising e-Translation

Selecting translation system

Translation system can be selected by setting the source language and the target language for each request. It is possible that there are more translation systems for the same language pair, but in different domain. So it is possible to set optionaly also domain parameter:

HTML Request

POST /current/e-translation/tilde?source-lang=en&target-lang=de&domain=legal HTTP/1.1
            Host: api.freme-project.eu
            Accept: application/rdf+xml
            Content-Type: text/plain
            The EU in brief. The EU is a unique economic and political partnership between 28 European countries that together cover much of the continent.

Curl example

curl -X POST -H "Accept: application/rdf+xml" -H "Content-Type: text/plain" -d 'The EU in brief. The EU is a unique economic and political partnership between 28 European countries that together cover much of the continent.' "https://api.freme-project.eu/current/e-translation/tilde?source-lang=en&target-lang=de&domain=legal"

In case of non-existing domain and language pair the server will respond with HTTP status code 404 Not Found

ITS 2.0 category support

e-Translation supports ITS 2.0 data categories. See a complete list of the supported categories and usage samples in this article: e-Internationalization.

ITS 2.0 data categories provide the possibility to include an MT confidence score to the output of e-Translation. This allows the post editors or other automatic or manual evaluators to more easily spot the areas with potentially weak translation.

Terminology markup and additional terminology information give the possibility to tune the results of e-Translation. ITS 2.0 terminology supporting categories allow to create a bridge between two independent e-Services - it supports transferring information from e-Terminology to e-Translation. This is done by annotating source text with NIF objects/terms and additionally providing terminology information in OntoLex Lemon. The MT engine extracts term translation in the target language from OntoLex data structures and chooses the best translation based on the terminology provided.

Also, the translate category is widely used and helps improve translation results by pointing out the areas of the source document that are not intended for translation.

List of systems

See a list of available public demo systems here: List of translation systems

The following system statuses are available:

Available systems mean that they are ready for translation, and standby systems mean that they need to wake up. Systems will be woken up with the first request and need a few minutes to start up. Systems will go to sleep if they are inactive for 60 minutes (no translations). Some systems are always in running mode, but if you find that this stand-by mode is problematic, then contact Tilde to resolve this.

Private systems

It is possible to train a translation system on private and proprietary data and then use it through the FREME server, while still keeping the data secure and confidential. Private systems are not listed on the public system list and will be accessible by providing a private key. That private key can be retrieved only by contacting Tilde.

To use a private MT system, add your key to the query string parameter list:

HTML Request

POST /current/e-translation/tilde?source-lang=en&target-lang=de&key=u-iuo-2323-444-223-ABC HTTP/1.1
Host: api.freme-project.eu
Accept: application/rdf+xml
Content-Type: text/plain

The EU in brief. The EU is a unique economic and political partnership between 28 European countries that together cover much of the continent.

In the case of an incorrect key, the server will return the HTTP status code 401 Unauthorized.