Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
成功添加部署后,你可以查询部署来基于分配给部署的模型预测你的语句中的意图和实体。 你可以通过预测 API 或通过客户端库 (Azure SDK) 以编程方式查询部署。
可使用 Language Studio 提交语句、获取预测并可视化结果。
通过 Language Studio 测试模型
在左侧菜单中,选择“测试部署”。
选择要测试的模型。 只能测试分配给部署的模型。
从部署名称下拉列表中,选择你的部署名称。
在文本框中,输入要测试的语句。
从顶部菜单中选择“运行测试”。
运行测试后,在结果中应会看到模型的响应。 可以在实体卡片视图中查看结果,或以 JSON 格式查看结果。
首先需要获取资源密钥和终结点:
在 Azure 门户中,转到资源概述页面。 在左侧菜单中,选择“密钥和终结点”。 你将为 API 请求使用终结点和密钥。
使用以下 URL、标头和 JSON 正文创建 POST 请求,开始测试业务流程工作流模型。
{ENDPOINT}/language/:analyze-conversations?api-version={API-VERSION}
占位符 | 值 | 示例 |
---|---|---|
{ENDPOINT} |
用于对 API 请求进行身份验证的终结点。 | https://<your-custom-subdomain>.cognitiveservices.azure.cn |
{API-VERSION} |
要调用的 API 的版本。 | 2023-04-01 |
使用以下标头对请求进行身份验证。
键 | 值 |
---|---|
Ocp-Apim-Subscription-Key |
资源密钥。 用于对 API 请求进行身份验证。 |
{
"kind": "Conversation",
"analysisInput": {
"conversationItem": {
"text": "Text1",
"participantId": "1",
"id": "1"
}
},
"parameters": {
"projectName": "{PROJECT-NAME}",
"deploymentName": "{DEPLOYMENT-NAME}",
"directTarget": "qnaProject",
"targetProjectParameters": {
"qnaProject": {
"targetProjectKind": "QuestionAnswering",
"callingOptions": {
"context": {
"previousUserQuery": "Meet Surface Pro 4",
"previousQnaId": 4
},
"top": 1,
"question": "App Service overview"
}
}
}
}
}
发送请求后,你将获得预测的以下响应!
{
"kind": "ConversationResult",
"result": {
"query": "App Service overview",
"prediction": {
"projectKind": "Orchestration",
"topIntent": "qnaTargetApp",
"intents": {
"qnaTargetApp": {
"targetProjectKind": "QuestionAnswering",
"confidenceScore": 1,
"result": {
"answers": [
{
"questions": [
"App Service overview"
],
"answer": "The compute resources you use are determined by the *App Service plan* that you run your apps on.",
"confidenceScore": 0.7384000000000001,
"id": 1,
"source": "https://learn.microsoft.com/azure/app-service/overview",
"metadata": {},
"dialog": {
"isContextOnly": false,
"prompts": []
}
}
]
}
}
}
}
}
}