python - 使用 Azure AI 训练自定义语音
问题描述
我需要帮助来完成我的一项项目工作,即“以编程方式使用 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>"
}
对于dataset kind
,如果您选择“音频 + 人工标记的成绩单”,则其值为Acoustic
,因为Plain text
其值为language
。因为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>"
}...
]
}
}
您可以project id
通过以下 API 获取和:
GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects
您可以dataset id
通过以下 API 获取:
GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>
您可以model id
通过以下 API 获取:
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>"
}
您可以model id
通过以下 API 获取:
GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>/models
推荐阅读
- html - 无法将背景图像应用于 div
- ios - SwiftUI:仅支持纵向视图?
- python - 是否可以检查一个类是否调用了特定的方法?
- schema.org - Schema.org/Rich Snippets:页面上定义的多个 ListItem 元素
- java - 映射休眠实体多对一
- python - 存储在 Keras 模型中的单独“偏差”权重是什么意思?
- java - CameraX Image Analysis (with OUTPUT_IMAGE_FORMAT_RGBA_8888) : maxImages (4) 已经被获取,在获取更多之前调用#close
- azure - 如何使用 OIDC 设置多租户 Azure AD SSO
- bash - 如何自动化远程服务器上的任务。如何从一个响应中获取价值以添加到下一个命令中?
- python - 如何在python中拆分列表