我有一个用例,其中:
我按照以下链接:https://github.com/Azure/LearnAI-Cognitive-Search/blob/master/05-Lab-2-Image-Skills.md
但在这里我知道只有2个预定义的技能是ImageAnalysisSkill
和OcrSkill
,它们没有提供完整的图像作为搜索结果。
请帮忙...
以编程方式,您可以使用图像分析认知技能自动从图像中提取标签。
有关此技能的更多信息,请参阅https://docs.microsoft.com/en-us/azure/search/cognitive-search-skill-image-analysis。
你的技能看起来像这样:
{ "@odata.type": "#Microsoft.Skills.Vision.ImageAnalysisSkill",
"context": "/document/normalized_images/*",
"visualFeatures": [
"Tags",
"Description"
],
"defaultLanguageCode": "en",
"inputs": [
{
"name": "image",
"source": "/document/normalized_images/*"
}
],
"outputs": [
{
"name": "tags",
"targetName": "myTags"
},
{
"name": "description",
"targetName": "myDescription"
}
]
}
然后在索引中,确保创建一个Collection(Edm.String)类型的字段以包含标记列表。我们称之为imageTags字段。确保该字段是可搜索的。
在输出字段映射(索引器的属性)中,您需要将标记列表映射到新创建的imageTags字段,如下所示:
"outputFieldMappings": [
{
"sourceFieldName": "/document/normalized_images/*/myDescription/tags/*",
"targetFieldName": "imageTags"
}
这将确保在图像上找到的每个标签都插入图像标签阵列中。
另请阅读本文档,该文档解释了如何提取normalized_images如果您已经不熟悉它:https://docs.microsoft.com/en-us/azure/search/cognitive-search-concept-image-scenarios