page_type | languages | products | name | description | azureDeploy | |||
---|---|---|---|---|---|---|---|---|
sample |
|
|
Acronym Linker sample skills for cognitive search |
These two custom skills (link-acronyms and link-acronyms-list) give definitions for known acronyms. |
These two custom skills (link-acronyms
and link-acronyms-list
) give definitions for known acronyms.
These skills have no additional requirements than the ones described in the root README.md
file.
This function uses a JSON file called acronyms.json
that can be found at the root of this project, and that will be deployed with the function. This file contains a simple dictionary of acronyms to definitions. We provided a sample file with this project that contains definitions for common computer-related acronyms. Please replace this file with your own data, or point LinkAcronyms
to your data.
{
"values": [
{
"recordId": "foobar2",
"data":
{
"word": "MS"
}
},
{
"recordId": "foo1",
"data":
{
"word": "SSL"
}
}
]
}
{
"values": [
{
"recordId": "foobar2",
"data": {
"acronym": {
"value": "MS",
"description": "Microsoft"
}
},
"errors": [],
"warnings": []
},
{
"recordId": "foo1",
"data": {
"acronym": {
"value": "SSL",
"description": "Secure Socket Layer"
}
},
"errors": [],
"warnings": []
}
]
}
{
"values": [
{
"recordId": "foobar2",
"data":
{
"words": [ "MS", "SSL" ]
}
}
]
}
{
"values": [
{
"recordId": "foobar2",
"data": {
"acronyms": [
{
"value": "MS",
"description": "Microsoft"
},
{
"value": "SSL",
"description": "Secure Socket Layer"
}
]
},
"errors": [],
"warnings": []
}
]
}
In order to use this skill in a cognitive search pipeline, you'll need to add a skill definition to your skillset. Here's a sample skill definition for this example (inputs and outputs should be updated to reflect your particular scenario and skillset environment):
{
"@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
"description": "Acronym linker",
"uri": "[AzureFunctionEndpointUrl]/api/link-acronyms-list?code=[AzureFunctionDefaultHostKey]",
"batchSize": 1,
"context": "/document/normalized_images/*/layoutText",
"inputs": [
{
"name": "words",
"source": "/document/normalized_images/*/layoutText/words/*/text"
}
],
"outputs": [
{
"name": "acronyms",
"targetName": "acronyms"
}
]
}