Dynamic Dictionary (AI Cognitive service) not working as expected
Hi all,
I am using the Translation Text api to translate some text from one language to another. Now we have a requirement to preserve some words during the translation and so we are trying to use the dynamic dictionary feature. However, what we see is an consistent behaviour.
As per the documentation the provided translation for one specific word should be used, nevertheless what we noticed is that it is also being translated if the context is meaninful enough;
E.g
https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&textType=HTML&from=en&to=es
[
{
"Text": "Welcome to the <mstrans:dictionary translation=\"Universe\">Universe</mstrans:dictionary>! This space is designed to help you unlock the full potential of something."
}
]
In our case we want to provide a translation for "Universe" to keep it is as it is.
The response:
{
"text": "¡Bienvenidos al Universo! Este espacio está diseñado para ayudarte a liberar todo el potencial de nuestros productos, conectarte con otros usuarios y compartir tus experiencias. Ya sea que esté buscando un conocimiento profundo del producto, consejos útiles o simplemente quiera interactuar con una comunidad de personas de ideas afines, está en el lugar correcto.",
"to": "es"
}
Looks like the word Universe was interpreted as part of the context and it was actually translated.
Then if I make a small tweak in the source value. Notice that I will add the "site".
[
{
"Text": "Welcome to the <mstrans:dictionary translation=\"Universe\">Universe</mstrans:dictionary> site! This space is designed to help you unlock the full potential of our products, connect with other users, and share your experiences. Whether you're looking for in-depth product knowledge, helpful tips, or just want to interact with a community of like-minded people, you're in the right place."
}
]
Now, the response is the one I would expect:
{
"text": "¡Bienvenidos al sitio de Universe! Este espacio está diseñado para ayudarte a liberar todo el potencial de nuestros productos, conectarte con otros usuarios y compartir tus experiencias. Ya sea que esté buscando un conocimiento profundo del producto, consejos útiles o simplemente quiera interactuar con una comunidad de personas de ideas afines, está en el lugar correcto.",
"to": "es"
}
Does anyone know what could be happening?
Thanks!