gpt4 book ai didi

python - 使用 Azure AI 训练自定义语音

转载 作者:行者123 更新时间:2023-12-03 03:49:06 25 4
gpt4 key购买 nike

我需要帮助来完成我的一项项目工作,其中提到“以编程方式使用 Azure AI 训练自定义语音(首选 Python)”,而不是使用自定义语音门户。由于我对 ML 非常陌生,因此我需要有关如何执行此任务的端到端详细信息。任何帮助/指导将不胜感激。

最佳答案

据我所知,Azure 尚未发布这些 API,但我尝试通过浏览器获取 HTTP 请求,以下是我的发现。

1.上传数据集:

网址:

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

标题:

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

正文:

{
"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>"
}

对于数据集类型,如果您选择“音频+人工标记的转录本”,则其值为Acoustic,对于纯文本,其值为语言。对于Pronunciation,其值为Pronunciation

2.训练模型:

网址

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

标题:

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

正文:

{
"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>"
}...
]
}
}

您可以通过以下API获取项目ID:

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

您可以通过以下API获取数据集id:

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

您可以通过以下API获取型号id:

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

3.部署模型:

网址:

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

标题:

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

正文:

{
"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>"
}

您可以通过以下API获取型号id:

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

关于python - 使用 Azure AI 训练自定义语音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67596536/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com