Share via

Language detection and translation is not proper

Avinash Gunjuluri 0 Reputation points Microsoft Employee
2024-10-19T17:52:37.8333333+00:00

I am using Azure Translator Service , however I see language detection and translation is not happening properly

I am using python, I have a define a function translate_text which calls Azure translator api and returns the translated text

I am not passing from-language parameter since I want the API to figure out the source language and translate it , however the detection and translation both are happening incorrectly.

if you see below example , the text I am sending is Slovak, but it detected pl, can you please help me undertand how to make this better.

Call to Translate API

a = translate_text("Urobit aj dalsie pokrocilejsie skolenia.")

display(a)

Response

https://api.cognitive.microsofttranslator.com/translate

[

{

    "detectedLanguage": {

        "language": "pl",

        "score": 0.9

    },

    "translations": [

        {

            "text": "Urobit and further shortened the skolenia.",

            "to": "en"

        }

    ]

}

]

'Urobit and further shortened the skolenia.'

Azure Translator in Foundry Tools

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.