Skip to content

Instantly share code, notes, and snippets.

@Sealjay
Created March 3, 2021 01:31
Show Gist options
  • Save Sealjay/f640c01e6b374cd37dd8e87581c8f895 to your computer and use it in GitHub Desktop.
Save Sealjay/f640c01e6b374cd37dd8e87581c8f895 to your computer and use it in GitHub Desktop.
cognitivesearch - ai skillset - merge text
{
"name": "mergetext",
"description": "Extract text from images and merge with content text to produce merged_text",
"skills": [
{
"@odata.type": "#Microsoft.Skills.Vision.OcrSkill",
"name": "#1",
"description": "Extract text (plain and structured) from image.",
"context": "/document/normalized_images/*",
"textExtractionAlgorithm": null,
"lineEnding": "Space",
"defaultLanguageCode": "en",
"detectOrientation": true,
"inputs": [
{
"name": "image",
"source": "/document/normalized_images/*"
}
],
"outputs": [
{
"name": "text",
"targetName": "text"
}
]
},
{
"@odata.type": "#Microsoft.Skills.Text.MergeSkill",
"name": "#2",
"description": "Create merged_text, which includes all the textual representation of each image inserted at the right location in the content field.",
"context": "/document",
"insertPreTag": " ",
"insertPostTag": " ",
"inputs": [
{
"name": "text",
"source": "/document/content"
},
{
"name": "itemsToInsert",
"source": "/document/normalized_images/*/text"
},
{
"name": "offsets",
"source": "/document/normalized_images/*/contentOffset"
}
],
"outputs": [
{
"name": "mergedText",
"targetName": "merged_text"
}
]
}
],
"cognitiveServices": null,
"knowledgeStore": null,
"encryptionKey": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment