Does the speech service allow automating the training of a custom speech model through powershell?

Dan Pham 0 Reputation points
2024-09-05T16:37:55.5833333+00:00

I would like to run training for a custom speech model but I want to do it through an automated pipeline instead of through the Speech Studio in Azure. Are there any apis that can be used to do this?
I would prefer to do this in powershell since all of our pipelines are written using powershell.
The documentation for Speech Service talks about a speech service cli but I do not have the authority to install that on our agents.

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,675 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 10,111 Reputation points
    2024-09-05T19:42:04.1966667+00:00

    Hello Dan Pham,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    Regarding your explanation, you would like to automate the training of a custom speech model through PowerShell.

    Absolutely, you can automate the training of a custom speech model using PowerShell with the Azure Speech service. This is an example of steps to take, use the links for more detailed steps and code snippet:

    #   Set Up Configuration
       spx --% config @key --set SpeechSubscriptionKey
       spx --% config @region --set SpeechServiceRegion
    #   Create a Custom Speech Project
       spx --% csr project create --name "ProjectName" --language "en-US" --description "Description" --output url "@project.txt"
    #   Upload Datasets for pronunciation data
         spx --% csr dataset upload --name "pronunciation_data" --description "data for pronunciation model" --data .\pronunciation.txt --kind Pronunciation --project "@project.txt" --output url "@dataset.pm.txt"
    #   For language model adaptation
         spx --% csr dataset upload --name "language_model_data" --description "data for language model adaptation" --data .\language_model.txt --kind Language --project "@project.txt" --output url "@dataset.lm.txt"
    #    For evaluation data
         spx --% csr dataset upload --name "test_data_1" --description "Test data for evaluation" --data .\test_data_1.zip --kind Acoustic --project "@project.txt" --output url "@dataset.test1.txt"
    #   Check Dataset Status
       spx --% csr dataset status --dataset "@dataset.pm.txt" --wait
    #   Train the Custom Model
       spx --% csr model train --project "@project.txt" --datasets "@dataset.pm.txt,@dataset.lm.txt" --output url "@model.txt"
    #   Evaluate the Model
       spx --% csr model evaluate --model "@model.txt" --dataset "@dataset.test1.txt" --output url "@evaluation.txt"
    

    These commands help automate the process of creating projects, uploading datasets, training models, and evaluating them https://github.com/Azure/custom-speech-stt/blob/main/automate.md and https://video2.skills-academy.com/en-us/azure/ai-services/speech-service/how-to-custom-speech-train-model

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

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