azure - 如何将不同的自定义技能组映射到索引
问题描述
尝试在技能集中添加自定义技能并将其映射到索引中
这是详细的
我在我的技能集中使用 azure Named Entity Recognition 作为
{
"@odata.type": "#Microsoft.Skills.Text.MergeSkill",
"description": "Merge text content with image tags",
"insertPreTag": " ",
"context": "/document",
"inputs": [
{
"name": "text",
"source": "/document/fullTextAndCaptions"
},
{
"name": "itemsToInsert",
"source": "/document/normalized_images/*/Tags/*/name"
}
],
"outputs": [
{
"name": "mergedText",
"targetName": "finalText"
}
]
}
在索引器中作为
{
"sourceFieldName": "/document/finalText/pages/*/entities/*/value",
"targetFieldName": "entities"
},
{
"sourceFieldName": "/document/finalText/pages/*/locations/*",
"targetFieldName": "locations"
},
它现在可以 100% 工作我想从https://github.com/Azure-Samples/azure-search-power-skills/tree/master/Text/Distinct添加 Distinct 自定义技能 我确实发布了该功能,当我去手动测试它,它按预期工作。但总体而言,它不适用于技能组合。我希望它获取位置并对其进行过滤并仅在搜索索引中它自己的字段中输出不同的值。我很难配置技能组和索引器以使其正常工作。
请问有什么帮助吗?
解决方案
您需要像这样添加独特的自定义技能,假设您想要对整个文档进行重复数据删除
{
"skills": [
...
{
"@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
"description": "Distinct skill",
"uri": "<https://distinct-skill>",
"context": "/document",
"inputs": [
{
"name": "locations",
"source": /document/finalText/pages/*/locations/*"
}
],
"outputs": [
{
"name": "distinct",
"targetName": "distinctLocations"
}
]
}
...
]
}
以及将其放入索引的输出字段映射。
{
"sourceFieldName": "/document/distinctLocations",
"targetFieldName": "distinctLocations"
}
有关添加自定义技能的信息,请参阅https://docs.microsoft.com/en-us/azure/search/cognitive-search-custom-skill-interface#sumption-custom-skills-from-skillset。
推荐阅读
- c++ - 如何使用 QOpenGLBuffer:: PixelUnpackBuffer
- trackpy - 改变 tp.annonate 中的粒子颜色
- java - 在 Atom 的初始化脚本中指定路径
- eclipse - HBox setMargin错误(HBox类型的静态方法设置边距(节点,昆虫)应该以静态方式访问)用于类分配
- mysql - 如何从 MySQL 中的列中选择 10 个最高值?
- bash - 将位置参数传递给包含 `.` 点的 bash 函数
- r - R:在 R 中绘制多项式
- python - TypeError: __str__ 在输出中返回非字符串(NoneType 类型)
- netlogo - 如何在 NetLogo 扩展中使用“打印”或“显示”?
- mysql - Feathers - PATCH 时 where 子句中的未知列