Translate API translation Confidence not language detection.

894 views
Skip to first unread message

Sarathchandar Doraiswami

unread,
Aug 21, 2017, 11:09:13 AM8/21/17
to Google Cloud Translation API
Hi,

I am creating a prototype for our data translation. We will need to translate 1000's of words from various languages to English and the other way too. In my current implementation I am using Googles .net API. And in that TranslateService.Translations.List().Execute for translating a collection of words.

At the moment I am trying to get the confidence score for each translation done in the list (not the Language Detection confidence). Does anyone have any idea how to get this?

And also I want to find out whether there is any way to get the alternative phrases for a translation.

Thanks,
Sarath

Kenworth (Google Cloud Platform)

unread,
Aug 21, 2017, 6:58:50 PM8/21/17
to Google Cloud Translation API
I understand that you want to get the confidence score for each translation done in the list. This is done by using the "/detect" endpoint to detect the language of a text string. But you mentioned this is not what you are looking for. As such, can you clarify the following:

1- What would be a sample proforma request and response for your query to get the confidence score? 
2- Do you intend to pass 1000+ words in a single query and get an array of 1000+ confidence scores?
3- "alternative phrases" - If you are talking about Phrase-Based Machine Translation (PBMT) as an alternative of Neural Machine Translation, you can find the doc here.

Sarathchandar Doraiswami

unread,
Aug 22, 2017, 5:03:22 AM8/22/17
to Google Cloud Translation API
Thanks for your reply Ken,

1. We have identified 3 possible requests we might need to make, please find it in the below table and there responses
2. I am looking for the confidence of the translation rather than language. To answer your second question, yes on the request and the response I expect the translated texts for each word and their confidence level.
3. What I mean by Alternative phrase is; when I pass "similares (Spanish)", the main translated text should be "Similar (english)" and Alternative Phrases: "Likenes (english)", "Sameness (englilsh)".

Request

Response

{

TranslationTexts: ["hi", "Yeh"],

SourceLanguage: "en",

TargetLanguage: "es"

}

 

{

TranslatedTexts: [ {

Text: "Hola",

Confidence: 100%,

Alternatives: [{ Text: "Hola2", Confidence: 90% }, { Text: "Hola3", Confidence: 80%} ]

},{

            Text: “Yeh”,

            Confidence: 80%,

Alternatives: [{ Text: "Si", Confidence: 60% } ]

} ]

 } 

Request – Detect source language

Response

{

TranslationTexts: ["hi", "Yeh"],

TargetLanguage: "es"

}

 

{

             From: “en”,

TranslatedTexts: [ {

Text: "Hola",

Confidence: 100%,

Alternatives: [{ Text: "Hola2", Confidence: 90% }, { Text: "Hola3", Confidence: 80%} ]

},{

            Text: “Yeh”,

            Confidence: 80%,

Alternatives: [{ Text: "Si", Confidence: 60% } ]

} ]

 } 

Request – detect source language from list and mixed language text

Response

{

TranslationTexts: ["hi", " test"],

SourceLanguages: [“en”, “zh”, “es”]

TargetLanguage: "en"

}

 

{

             From: “en”,

TranslatedTexts: [ {

Text: "Hola",

Confidence: 100%,

Alternatives: [{ Text: "Hola2", Confidence: 90% }, { Text: "Hola3", Confidence: 80%} ]

},{

            Text: “AMP HOURS test”,

            Confidence: 80%,

Alternatives: ]

} ]

 } 



Thanks,
Sarath


Kenworth (Google Cloud Platform)

unread,
Aug 23, 2017, 10:43:58 PM8/23/17
to Google Cloud Translation API
Thank you for providing more information. Based on the above, I highly encourage you submit a feature request as described in this article so that proper attention will be given to it. You can also refer on this thread, if required. Please feel free to drop the link of the feature request here so that we may be able to help other community users that has similar feature needs.

James Salsman

unread,
Jan 24, 2018, 9:27:20 AM1/24/18
to Google Cloud Translation API
Sarath, did you ever submit this feature request? It's easy for Google to do and very useful for everyone.

Kenworth, what is the status of the request?

James Salsman

unread,
Feb 12, 2018, 9:03:11 AM2/12/18
to Google Cloud Translation API
Kenworth, would you say whether a feature request for numeric per-word translation confidence scores has been made, please?

James Salsman

unread,
Feb 24, 2018, 9:26:29 AM2/24/18
to Google Cloud Translation API
I submitted the feature request for translation word confidence scores at https://issuetracker.google.com/issues/73830349

Please star it. Thank you!

James Salsman

unread,
Apr 25, 2018, 9:11:36 AM4/25/18
to Google Cloud Translation API
Could a Googler who can read https://issuetracker.google.com/issues/73848169 please say why it is blocking word translation scores? (https://issuetracker.google.com/issues/73830349

Unless there are security implications, which is very doubtful in this case, why would blocking issues be nontransparent like that?

Reply all
Reply to author
Forward
0 new messages