【问题标题】:Azure Congnitive Service Skill not persisting custom skill valueAzure 认知服务技能不保留自定义技能值
【发布时间】:2021-11-29 11:10:17
【问题描述】:

我已经为我的 Azure 认知服务创建了一个自定义技能。创建数据源、索引、索引器并运行索引器后,我可以看到正在调用我的函数并且它正在输出正确的信息,但是当我搜索索引时,连接到自定义技能的字段为空。

这是我的索引器定义:

{
  "name": "idxdocs",
  "description": null,
  "dataSourceName": "dsdocs",
  "skillsetName": "skillset-procuradores",
  "targetIndexName": "customer-documents",
  "disabled": null,
  "schedule": null,
  "parameters": {
    "batchSize": null,
    "maxFailedItems": -1,
    "maxFailedItemsPerBatch": null,
    "base64EncodeKeys": null,
    "configuration": {
      "indexedFileNameExtensions": ".pdf,.docx,.doc",
      "dataToExtract": "contentAndMetadata",
      "failOnUnprocessableDocument": false,
      "failOnUnsupportedContentType": false,
      "indexStorageMetadataOnlyForOversizedDocuments": true,
      "allowSkillsetToReadFileData": true
    }
  },
  "fieldMappings": [],
  "outputFieldMappings": [
    {
      "sourceFieldName": "/document/content/procuradores",
      "targetFieldName": "procuradores"
    }
  ],
  "cache": null,
  "encryptionKey": null
}

这是我的索引:

{
  "name": "customer-documents",
  "fields": [
    {
      "name": "key",
      "type": "Edm.String",
      "facetable": true,
      "filterable": true,
      "key": true,
      "retrievable": true,
      "searchable": false,
      "sortable": true,
      "analyzer": null,
      "indexAnalyzer": null,
      "searchAnalyzer": null,
      "synonymMaps": [],
      "fields": []
    },
    {
      "name": "content",
      "type": "Edm.String",
      "facetable": false,
      "filterable": false,
      "key": false,
      "retrievable": true,
      "searchable": true,
      "sortable": false,
      "analyzer": "es.lucene",
      "indexAnalyzer": null,
      "searchAnalyzer": null,
      "synonymMaps": [],
      "fields": []
    },
    {
      "name": "procuradores",
      "type": "Edm.String",
      "facetable": false,
      "filterable": true,
      "key": false,
      "retrievable": true,
      "searchable": false,
      "sortable": false,
      "analyzer": null,
      "indexAnalyzer": null,
      "searchAnalyzer": null,
      "synonymMaps": [],
      "fields": []
    }
  ],
  "suggesters": [],
  "scoringProfiles": [],
  "defaultScoringProfile": null,
  "corsOptions": null,
  "analyzers": [],
  "charFilters": [],
  "tokenFilters": [],
  "tokenizers": [],
  "similarity": {
    "@odata.type": "#Microsoft.Azure.Search.BM25Similarity",
    "k1": null,
    "b": null
  },
  "encryptionKey": null,
  "@odata.etag": "\"0x8D98BC85E9F6996\""
}

我的技能定义:

{
  "name": "skillset-procuradores",
  "description": "",
  "skills": [
    {
      "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
      "name": "procuradores",
      "description": "",
      "context": "/document",
      "uri": "my url ommited for secure reasons",
      "httpMethod": "POST",
      "timeout": "PT3M50S",
      "batchSize": 1,
      "degreeOfParallelism": null,
      "inputs": [
        {
          "name": "text",
          "source": "/document/content"
        }
      ],
      "outputs": [
        {
          "name": "procuradores",
          "targetName": "procuradores"
        }
      ],
      "httpHeaders": {}
    }
  ],
  "cognitiveServices": null,
  "knowledgeStore": null,
  "encryptionKey": null
} 

最后是我的函数输出:

{
    "values": [
        {
            "recordId": "1",
            "data": {
                "procuradores": "people's names"
            }
        }
    ]
}

我错过了什么?

【问题讨论】:

    标签: json azure azure-cognitive-search


    【解决方案1】:

    Rafael,你能试试调试会话吗?我怀疑您的自定义技能中发生了一些事情,这意味着数据没有回来。通过使用它,您可以测试实际的输入和输出。

    https://docs.microsoft.com/en-us/azure/search/cognitive-search-debug-session

    【讨论】:

      【解决方案2】:

      这只是一种预感,但在索引器定义中,请尝试将您的输出字段映射 sourceFieldName 从“/document/content/procuradores”更改为“/document/procuradores”。您在技能中提供的上下文只是“/document”,因此它应该将输出附加到它上面。

      【讨论】:

        猜你喜欢
        • 2020-02-23
        • 2021-05-24
        • 2023-01-05
        • 2018-12-31
        • 1970-01-01
        • 2019-11-28
        • 2017-07-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多