翻译技能不写字段输出
Translation Skill not writing fields to output
我一直无法将翻译后的内容字段输出到我的结果中。
这是查询的示例结果。我希望我的技能集能够根据定义的两项技能输出 6 个额外的字段。
{
"@odata.context": "https://text-skill-test.search.windows.net/indexes('translate-english1')/$metadata#docs(*)",
"value": [
{
"@search.score": 1,
"index_id": "1",
"metadata_content_type": null,
"language": null,
"title": "3 Things to Know About Release Notes",
"content": "\r\n<p>Hey there Office Insiders!</p>\r\n"
}
]
}
我的索引器:
{
"@odata.context": "https://text-skill-test.search.windows.net/$metadata#indexers/$entity",
"name": "indexer1613347856608",
"description": null,
"dataSourceName": "englishfolder",
"skillsetName": "azureblob-skillset",
"targetIndexName": "translate-english1",
"disabled": null,
"schedule": null,
"parameters": {
"batchSize": null,
"maxFailedItems": 0,
"maxFailedItemsPerBatch": 0,
"base64EncodeKeys": null,
"configuration": {
"dataToExtract": "contentAndMetadata",
"parsingMode": "json"
}
},
"fieldMappings": [
{
"sourceFieldName": "metadata_storage_path",
"targetFieldName": "index_id",
"mappingFunction": {
"name": "base64Encode",
"parameters": null
}
}
],
"outputFieldMappings": [
{
"sourceFieldName": "/document/title",
"targetFieldName": "title"
},
{
"sourceFieldName": "/document/content",
"targetFieldName": "content"
}
]
}
我的技能定义是这样的。我也试过使用下面的源字段并省略 /document 但它没有用。
{
"@odata.context": "https://text-skill-test.search.windows.net/$metadata#skillsets/$entity",
"@odata.etag": "\"0x8D8D1466CF19C8E\"",
"name": "azureblob-skillset",
"description": "Skillset created from the portal. skillsetName: azureblob-skillset; contentField: metadata_storage_content_type; enrichmentGranularity: document; knowledgeStoreStorageAccount: ;",
"skills": [
{
"@odata.type": "#Microsoft.Skills.Text.TranslationSkill",
"name": "#1",
"description": null,
"context": "/document",
"defaultFromLanguageCode": null,
"defaultToLanguageCode": "fr",
"suggestedFrom": "en",
"inputs": [
{
"name": "text",
"source": "/document/content"
}
],
"outputs": [
{
"name": "translatedText",
"targetName": "translatedContentText_fr"
},
{
"name": "translatedFromLanguageCode",
"targetName": "translatedContentFromLanguageCode_fr"
},
{
"name": "translatedToLanguageCode",
"targetName": "translatedContentToLanguageCode_fr"
}
]
},
{
"@odata.type": "#Microsoft.Skills.Text.TranslationSkill",
"name": "#2",
"description": null,
"context": "/document",
"defaultFromLanguageCode": null,
"defaultToLanguageCode": "fr",
"suggestedFrom": "en",
"inputs": [
{
"name": "text",
"source": "/document/title"
}
],
"outputs": [
{
"name": "translatedText",
"targetName": "translatedTitle_fr"
},
{
"name": "translatedFromLanguageCode",
"targetName": "translatedTitleFromLanguageCode_fr"
},
{
"name": "translatedToLanguageCode",
"targetName": "translatedTitleToLanguageCode_fr"
}
]
}
],
"cognitiveServices": null,
"knowledgeStore": null,
"encryptionKey": null
}
20 个成功的文档,没有错误或警告:
我还需要查看您的索引定义以查明修复方法。您的索引器有一个问题:
不正确的索引器输出字段映射。在输出字段映射中添加以下对象。
{
"sourceFieldName": "/document/translatedContentText_fr",
"targetFieldName": "你的法语文本索引字段名称",
“映射功能”:空
}
您可能会遇到第二个问题,即索引定义中缺少该字段。要解决此问题,请将一个字段添加到 EDM.String 类型的索引,并在上述输出字段映射中使用该名称。确保该字段至少是可检索的。
我一直无法将翻译后的内容字段输出到我的结果中。
这是查询的示例结果。我希望我的技能集能够根据定义的两项技能输出 6 个额外的字段。
{
"@odata.context": "https://text-skill-test.search.windows.net/indexes('translate-english1')/$metadata#docs(*)",
"value": [
{
"@search.score": 1,
"index_id": "1",
"metadata_content_type": null,
"language": null,
"title": "3 Things to Know About Release Notes",
"content": "\r\n<p>Hey there Office Insiders!</p>\r\n"
}
]
}
我的索引器:
{
"@odata.context": "https://text-skill-test.search.windows.net/$metadata#indexers/$entity",
"name": "indexer1613347856608",
"description": null,
"dataSourceName": "englishfolder",
"skillsetName": "azureblob-skillset",
"targetIndexName": "translate-english1",
"disabled": null,
"schedule": null,
"parameters": {
"batchSize": null,
"maxFailedItems": 0,
"maxFailedItemsPerBatch": 0,
"base64EncodeKeys": null,
"configuration": {
"dataToExtract": "contentAndMetadata",
"parsingMode": "json"
}
},
"fieldMappings": [
{
"sourceFieldName": "metadata_storage_path",
"targetFieldName": "index_id",
"mappingFunction": {
"name": "base64Encode",
"parameters": null
}
}
],
"outputFieldMappings": [
{
"sourceFieldName": "/document/title",
"targetFieldName": "title"
},
{
"sourceFieldName": "/document/content",
"targetFieldName": "content"
}
]
}
我的技能定义是这样的。我也试过使用下面的源字段并省略 /document 但它没有用。
{
"@odata.context": "https://text-skill-test.search.windows.net/$metadata#skillsets/$entity",
"@odata.etag": "\"0x8D8D1466CF19C8E\"",
"name": "azureblob-skillset",
"description": "Skillset created from the portal. skillsetName: azureblob-skillset; contentField: metadata_storage_content_type; enrichmentGranularity: document; knowledgeStoreStorageAccount: ;",
"skills": [
{
"@odata.type": "#Microsoft.Skills.Text.TranslationSkill",
"name": "#1",
"description": null,
"context": "/document",
"defaultFromLanguageCode": null,
"defaultToLanguageCode": "fr",
"suggestedFrom": "en",
"inputs": [
{
"name": "text",
"source": "/document/content"
}
],
"outputs": [
{
"name": "translatedText",
"targetName": "translatedContentText_fr"
},
{
"name": "translatedFromLanguageCode",
"targetName": "translatedContentFromLanguageCode_fr"
},
{
"name": "translatedToLanguageCode",
"targetName": "translatedContentToLanguageCode_fr"
}
]
},
{
"@odata.type": "#Microsoft.Skills.Text.TranslationSkill",
"name": "#2",
"description": null,
"context": "/document",
"defaultFromLanguageCode": null,
"defaultToLanguageCode": "fr",
"suggestedFrom": "en",
"inputs": [
{
"name": "text",
"source": "/document/title"
}
],
"outputs": [
{
"name": "translatedText",
"targetName": "translatedTitle_fr"
},
{
"name": "translatedFromLanguageCode",
"targetName": "translatedTitleFromLanguageCode_fr"
},
{
"name": "translatedToLanguageCode",
"targetName": "translatedTitleToLanguageCode_fr"
}
]
}
],
"cognitiveServices": null,
"knowledgeStore": null,
"encryptionKey": null
}
20 个成功的文档,没有错误或警告:
我还需要查看您的索引定义以查明修复方法。您的索引器有一个问题:
不正确的索引器输出字段映射。在输出字段映射中添加以下对象。 { "sourceFieldName": "/document/translatedContentText_fr", "targetFieldName": "你的法语文本索引字段名称", “映射功能”:空 }
您可能会遇到第二个问题,即索引定义中缺少该字段。要解决此问题,请将一个字段添加到 EDM.String 类型的索引,并在上述输出字段映射中使用该名称。确保该字段至少是可检索的。