Train custom voice using Azure AI

Viewed 73

I need help in completing one of my project work which says "train a custom voice using Azure AI programmatically(python preferred)", not with the custom voice portal. Since I'm very new to ML, I need an end-to-end detail on how to perform this task. Any help/guidance would be appreciated.

1 Answers

As far as I know, Azure has not released these APIs yet, but I tried to fetch HTTP requests via browser and these is my findings below.

1. Upload data set:

URL:

POST https://<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/datasets

Header:

Content-Type: application/json
Ocp-Apim-Subscription-Key: <key>

Body:

{
    "displayName": "<name>",
    "description": "<description>",
    "dataImportKind": "<dataset kind>",
    "datasetKind": "<dataset kind>",
    "kind": "<dataset kind>",
    "sourceUrl": "<dataset URL>",
    "contentUrl": "<dataset URL>",
    "locale": "<locale, ie, en-us>",
    "project": {
        "id": "<your project ID>",
        "self": "https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<your project ID>"
    },
    "properties": {
        "email": "<contactor email>"
    },
    "customProperties": {
        "PortalAPIVersion": "3"
    },
    "email": "<contactor email>"
}

For dataset kind, if you select "Audio + human-labeled transcript" its value is Acoustic, for Plain text its value is language. for Pronunciation its value is Pronunciation.

2. Train a model:

URL

POST https://<NAME>.cognitiveservices.azure.com/speechtotext/v3.0/models

Headers:

Content-Type: application/json
Ocp-Apim-Subscription-Key: <key>

Body:

{
    "displayName": "<name>",
    "description": "<desp>",
    "locale": "en-US",
    "project": {
        "id": "<project ID>",
        "self": "https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project ID>"
    },
    "properties": {
        "email": "<email>"
    },
    "customProperties": {
        "PortalAPIVersion": "3"
    },
    "email": "<email>",
    "datasets": [{
            "id": "<dataset id>",
            "self": "https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/datasets/<dataset id>"
        }...
    ]
    }
}

You can get project id and by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects

You can get dataset id by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>

You can get model id by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>

3. Deploy model:

URL :

POST https://<NAME>.cognitiveservices.azure.com/speechtotext/v3.0/endpoints

Headers:

Content-Type: application/json
Ocp-Apim-Subscription-Key: <key>

Body:

{
    "displayName": "<name>",
    "description": "<description>",
    "locale": "<locale>",
    "project": {
        "id": "<project id>",
        "self": "https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>"
    },
    "model": {
        "id": "<model id>",
        "self": "https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/models/<model id>"
    },
    "properties": {
        "email": "<email>",
        "contentLoggingEnabled": false,
        "loggingEnabled": false
    },
    "customProperties": {
        "contentLoggingEnabled": false,
        "PortalAPIVersion": "3"
    },
    "email": "<email>"
}

You can get model id by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>/models
Related