Translation difference between google cloud translation api and google translate web

2,208 views
Skip to first unread message

TM

unread,
Jun 20, 2018, 5:26:54 PM6/20/18
to Google Cloud Translation API
Hello,

We observed different translation results when sending same source strings to google cloud translation api and google translate web.  For example, for the source string of "From the <g>Data</g> tab, click <g>Create Process Datafields</g>", Google cloud translation API returns the translation of French as "Du <g> Les données </g> onglet, cliquez sur <g> Créer des processus Champs de données </g>".  
While google translate web returns as "Dans l'onglet <g> Données </ g>, cliquez sur <g> Créer des champs de données de processus </ g>".  The translation from google translate web is better.  
We wonder if google cloud translation api has different algorithm in translation model than that in google translate web.  What causes the difference of translations?

Thank you for your time in advance.


Kenworth (Google Cloud Platform)

unread,
Jun 21, 2018, 10:14:58 AM6/21/18
to Google Cloud Translation API
Google Translate and Cloud Translation API are two different products doing some similar functions. It is safe to assume they have different algorithms and differences in translations are not only common but expected.

George (Cloud Platform Support)

unread,
Jun 23, 2018, 5:49:23 PM6/23/18
to Google Cloud Translation API
The Translation API webpage and the Translation API currently use the 'base' default Phrase-Based Machine Translation (PBMT) model. Not so https://translate.google.com/, a site that is testing the new  Neural Machine Translation (NMT) model for translation. 

BM

unread,
Jun 25, 2018, 9:52:04 AM6/25/18
to Google Cloud Translation API
Hi TM,

I noticed the same thing. And I consider this a problem to report. 
Google API is not a free service, so, I expect, when I give money to a provider for something that he offer for free, to get a better product and not a bad one.
BR

Sudheera Vanguri

unread,
Jun 28, 2018, 9:11:17 AM6/28/18
to Google Cloud Translation API
This appears to due to default parameters set on translate.google.com  which can easily be set on Cloud translate API.
The translations are different in this case because when you've called the Cloud API, the translation is interpreted as HTML. All that is needed is to reproduce the preferred translation is to set parameter to "text". When translated as "text", you get the same translation as on translate.google.com

Cloud Translate is an enterprise grade API that returns the best estimated translation for every query and can support the availability, varying volume requirements of enterprise/developer usage incl. significantly high volume RESTful requests. translate.google.com is rate-limited, may be subject to experimental updates, limited to 5000 characters on the web UI, has different non-customizable features(Spell Correction), doesn’t guarantee quality/performance that a cloud API is designed for. As for the issue, 

Calling the API with format set to HTML:

{
  "data": {
    "translations": [
      {
        "translatedText": "Du \u003cg\u003e Les données \u003c/g\u003e onglet, cliquez sur \u003cg\u003e Créer des champs de données de processus \u003c/g\u003e"
      }
    ]
  }
}
-> Matches what is reported:
Du <g> Les données </g> onglet, cliquez sur <g> Créer des processus Champs de données </g>"

Calling the API with format set to text:

curl  "https://translation.googleapis.com/language/translate/v2?key=KEY&q=From%20the%20%3Cg%3EData%3C%2Fg%3E%20tab%2C%20click%20%3Cg%3ECreate%20Process%20Datafields%3C%2Fg%3E&target=fr&source=en&format=text"
{
  "data": {
    "translations": [
      {
        "translatedText": "Dans l'onglet \u003cg\u003e Données \u003c/ g\u003e, cliquez sur \u003cg\u003e Créer des champs de données de processus \u003c/ g\u003e"
      }
    ]
  }
}

Dans l'onglet <g> Données </ g>, cliquez sur <g> Créer des champs de données de processus </ g>

Calling it without setting the format:
curl  "https://translation.googleapis.com/language/translate/v2?key=KEY&q=From%20the%20%3Cg%3EData%3C%2Fg%3E%20tab%2C%20click%20%3Cg%3ECreate%20Process%20Datafields%3C%2Fg%3E&target=fr&source=en"
Reply all
Reply to author
Forward
0 new messages