你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Question Answering Projects - Import
导入项目资产。
POST {Endpoint}/language/query-knowledgebases/projects/{projectName}/:import?api-version=2021-10-01
POST {Endpoint}/language/query-knowledgebases/projects/{projectName}/:import?api-version=2021-10-01&format={format}&assetKind={assetKind}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
Endpoint
|
path | True |
string |
支持的认知服务终结点 (例如 https://.api.cognitiveservices.azure.com). |
project
|
path | True |
string |
要使用的项目的名称。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
asset
|
query |
string |
项目的资产类型。 |
|
format
|
query |
知识库导入或导出格式。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
请求正文
名称 | 类型 | 说明 |
---|---|---|
assets |
此项目的所有资产。 |
|
fileUri |
string |
导入数据文件 URI。 |
metadata |
创建项目所需的参数。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
带有用于检查作业状态的 Operation-Location 标头的成功调用结果。 Headers Operation-Location: string |
|
Other Status Codes |
错误响应。 |
安全性
Ocp-Apim-Subscription-Key
Type:
apiKey
In:
header
示例
Successful query
Sample Request
POST {Endpoint}/language/query-knowledgebases/projects/proj1/:import?api-version=2021-10-01
{
"assets": {
"synonyms": [
{
"alterations": [
"wa",
"washington",
"washington state"
]
},
{
"alterations": [
"U.S",
"usa",
"united states of america"
]
}
],
"qnas": [
{
"lastUpdatedDateTime": "2021-05-01T17:21:14Z",
"id": 1,
"answer": "ans1",
"source": "source1",
"questions": [
"question 1.1",
"question 1.2"
],
"metadata": {
"k1": "v1",
"k2": "v2"
},
"dialog": {
"isContextOnly": false,
"prompts": [
{
"displayOrder": 1,
"qnaId": 11,
"displayText": "prompt 1.1"
},
{
"displayOrder": 2,
"qnaId": 21,
"displayText": "prompt 1.2"
}
]
}
},
{
"lastUpdatedDateTime": "2021-05-01T17:21:14Z",
"id": 2,
"answer": "ans2",
"source": "source2",
"questions": [
"question 2.1",
"question 2.2"
]
}
]
}
}
Sample Response
Operation-Location: job1
定义
名称 | 说明 |
---|---|
Assets |
此项目的所有资产。 |
Create |
创建项目所需的参数。 |
Error |
错误对象。 |
Error |
人类可读的错误代码。 |
Error |
错误响应。 |
format |
知识库导入或导出格式。 |
Import |
需要导入 的项目资产。 |
Import |
导入 QnA 记录。 |
Inner |
人类可读的错误代码。 |
Inner |
包含有关错误的更具体信息的对象。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。 |
Project |
项目的可配置设置。 |
Qna |
与 QnA 记录关联的对话框。 |
Qna |
提示输入答案。 |
Qna |
QnA 记录。 |
Suggested |
主动学习功能建议的问题。 |
Suggested |
主动学习建议的问题群集详细信息。 |
Word |
单词更改的集合。 |
Assets
此项目的所有资产。
名称 | 类型 | 说明 |
---|---|---|
qnas |
要导入的 QnA 记录的列表。 |
|
synonyms |
同义词的集合。 |
CreateProjectOptions
创建项目所需的参数。
名称 | 类型 | 说明 |
---|---|---|
description |
string |
项目的说明。 |
language |
string |
文本记录的语言。 这是语言的 BCP-47 表示形式。 例如,对英语使用“en”;西班牙语等的“es”。如果未设置,则默认使用英语的“en”。 |
multilingualResource |
boolean |
设置为 true 以允许为同一资源使用不同语言创建知识库。 |
settings |
项目的可配置设置。 |
Error
错误对象。
名称 | 类型 | 说明 |
---|---|---|
code |
服务器定义的一组错误代码中的一个。 |
|
details |
Error[] |
有关导致此项报告错误的特定错误的详细信息数组。 |
innererror |
一个 对象,该对象包含比当前对象更具体的错误信息。 |
|
message |
string |
错误的用户可读表示形式。 |
target |
string |
错误的目标。 |
ErrorCode
人类可读的错误代码。
名称 | 类型 | 说明 |
---|---|---|
AzureCognitiveSearchIndexLimitReached |
string |
|
AzureCognitiveSearchIndexNotFound |
string |
|
AzureCognitiveSearchNotFound |
string |
|
AzureCognitiveSearchThrottling |
string |
|
Forbidden |
string |
|
InternalServerError |
string |
|
InvalidArgument |
string |
|
InvalidRequest |
string |
|
NotFound |
string |
|
OperationNotFound |
string |
|
ProjectNotFound |
string |
|
ServiceUnavailable |
string |
|
TooManyRequests |
string |
|
Unauthorized |
string |
ErrorResponse
错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
format
知识库导入或导出格式。
名称 | 类型 | 说明 |
---|---|---|
excel |
string |
导出或导入知识库 副本 (replica) 包括 Tsv 格式的所有资产和元数据。 |
json |
string |
以 JSON 格式导出或导入 QnA 资产。 |
tsv |
string |
导出或导入知识库 副本 (replica) 包括 Excel 格式的所有资产和元数据。 |
ImportJobOptions
需要导入 的项目资产。
名称 | 类型 | 说明 |
---|---|---|
assets |
此项目的所有资产。 |
|
fileUri |
string |
导入数据文件 URI。 |
metadata |
创建项目所需的参数。 |
ImportQnaRecord
导入 QnA 记录。
名称 | 类型 | 说明 |
---|---|---|
activeLearningSuggestions |
针对 QnA 的主动学习建议列表。 |
|
answer |
string |
答案文本。 |
dialog |
QnA 的上下文。 |
|
id |
integer |
QnA 的唯一 ID。 |
lastUpdatedDateTime |
string |
上次更新 QnA 的日期时间。 |
metadata |
object |
与答案关联的元数据,可用于对问题答案进行分类或筛选。 |
questions |
string[] |
与答案关联的问题列表。 |
source |
string |
QnA 从中编制索引的源,例如 https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs 。 |
sourceDisplayName |
string |
源的友好名称。 |
InnerErrorCode
人类可读的错误代码。
名称 | 类型 | 说明 |
---|---|---|
AzureCognitiveSearchNotFound |
string |
|
AzureCognitiveSearchThrottling |
string |
|
ExtractionFailure |
string |
|
InvalidParameterValue |
string |
|
InvalidRequest |
string |
|
KnowledgeBaseNotFound |
string |
InnerErrorModel
包含有关错误的更具体信息的对象。 根据 Microsoft One API 指南 - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。
名称 | 类型 | 说明 |
---|---|---|
code |
服务器定义的一组错误代码中的一个。 |
|
details |
object |
错误详细信息。 |
innererror |
一个 对象,该对象包含比当前对象更具体的错误信息。 |
|
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ProjectSettings
项目的可配置设置。
名称 | 类型 | 说明 |
---|---|---|
defaultAnswer |
string |
在知识库中找不到良好匹配项时的默认应答响应。 |
QnaDialog
与 QnA 记录关联的对话框。
名称 | 类型 | 说明 |
---|---|---|
isContextOnly |
boolean |
标记提示是否仅与上一个问题相关。 如果为 true,则不要将此 QnA 作为无上下文查询的答案;否则,将忽略上下文并在答案中包含此 QnA。 |
prompts |
与答案关联的提示列表。 |
QnaPrompt
提示输入答案。
名称 | 类型 | 说明 |
---|---|---|
displayOrder |
integer |
提示的索引。 它用于对提示进行排序。 |
displayText |
string |
显示表示后续问题提示的文本。 |
qna |
QnA 记录。 QnAId 或 QnA 记录都需要出现在提示中。 |
|
qnaId |
integer |
对应于提示的 QnA 的 ID。 |
QnaRecord
QnA 记录。
名称 | 类型 | 说明 |
---|---|---|
activeLearningSuggestions |
针对 QnA 的主动学习建议列表。 |
|
answer |
string |
答案文本。 |
dialog |
QnA 的上下文。 |
|
id |
integer |
QnA 的唯一 ID。 |
metadata |
object |
与答案关联的元数据,可用于对问题答案进行分类或筛选。 |
questions |
string[] |
与答案关联的问题列表。 |
source |
string |
QnA 从中编制索引的源,例如 https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs 。 |
SuggestedQuestion
主动学习功能建议的问题。
名称 | 类型 | 说明 |
---|---|---|
autoSuggestedCount |
integer |
主动学习算法自动建议问题的次数。 |
question |
string |
主动学习功能建议的问题。 |
userSuggestedCount |
integer |
用户显式建议问题的次数。 |
SuggestedQuestionsCluster
主动学习建议的问题群集详细信息。
名称 | 类型 | 说明 |
---|---|---|
clusterHead |
string |
通过主动学习聚类分析算法选择作为建议问题群集的头的问题。 |
suggestedQuestions |
QnA 的所有建议问题的列表。 |
WordAlterations
单词更改的集合。
名称 | 类型 | 说明 |
---|---|---|
alterations |
string[] |
单词更改的集合。 |