How to use customized model with Speech Translate?

Jussi Muilu 1 Reputation point
2021-03-11T10:50:22.497+00:00

We are trying to create speech translation app using customized models for speech recgonition and translation. We have created a custom speech recognition model that performs quite well on our domain. We have also trained some custom translation models for the translation.

Previously we have used the results of speech recognition as input to translation service but in order to simplify the app and remove some latency we are looking for using the SpeechTranslator of the SpeechSDK

Now the problem is that I can't get the speechSDK TranslationRecognizer (javascript) to use my custom speech recognition model.

When using regular speech recognition I create a SpeechRecgonizer config using auth token and then set the custom enpointId value.

I tried the same with the TranslationRecognizer. The translation works but it clearly uses the baseline speech recgonition model instead of our custom model. I tried to create the TranslationRecognizer using the configuration created with fromEndpoint methdo but didn't get any results from there...

The custom speech recognition model is using Finnish -language

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,458 questions
Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
352 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,468 questions
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 47,256 Reputation points
    2021-03-23T09:13:19.477+00:00

    Hello,

    Thanks for your response. Please try below sample code for how to use your custom model:
    var sourceLanguageConfig = SourceLanguageConfig.FromLanguage("de-DE", "The Endpoint ID for your custom model.");
    var recognizer = new SpeechRecognizer(speechConfig, sourceLanguageConfig, audioConfig);

    SpeechRecognitionLanguage and EndpointId set methods are deprecated from the SpeechConfig class in C#. The use of these methods are discouraged, and shouldn't be used when constructing a SpeechRecognizer. I think this should be the error in your sample

    More details please check :
    https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-specify-source-language?pivots=programming-language-csharp

    Sorry for the delay and hope this helps.

    Regards,
    Yutong