Snowflake Gen AI Functions · Topic 24 of 26
Data Extraction, Enrichment, Augmentation and Transformation with Cortex Functions
Map each data pipeline task, extraction, enrichment, augmentation and transformation, to the right Cortex AI function and avoid the usual look-alike traps.
- 4 min
- Extraction pulls what exists, enrichment adds attributes, augmentation generates new content, transformation changes form or language.
AI_EXTRACT,AI_PARSE_DOCUMENT,AI_TRANSCRIBEare the extraction set.AI_CLASSIFY,AI_SENTIMENT,AI_SUMMARIZEandAI_EMBEDenrich.
What it is
Pipeline scenarios use four verbs that sound alike. The exam gives a task and asks for the function, so you must separate them.
| Task | Meaning | Typical functions |
|---|---|---|
| Extraction | Pull existing facts out of text, files or audio | AI_EXTRACT, AI_PARSE_DOCUMENT, AI_TRANSCRIBE |
| Enrichment | Add a derived attribute to each record | AI_CLASSIFY, AI_SENTIMENT, AI_SUMMARIZE, AI_EMBED |
| Augmentation | Create new content or records that were not there | AI_COMPLETE for generated text or synthetic data |
| Transformation | Change the form of data, not its meaning | AI_TRANSLATE, AI_REDACT, AI_COMPLETE with structured output |
How it works
Extraction
Extraction finds what is already in the source. It does not invent anything.
AI_EXTRACT: named fields, lists and tables from text, images and documents. The result is JSON withresponseanderror. Entity questions are limited to 100 per call.AI_PARSE_DOCUMENT: the whole document as text (OCR) or Markdown (LAYOUT), when you need all of it for later steps.AI_TRANSCRIBE: speech from audio or video to text.AI_COMPLETEwithresponse_format: pulls fields from free text into a JSON schema you define.
If the answer is already written in the source, the task is extraction. If the model must create something new, it is augmentation.
Enrichment
Enrichment adds a column to each row, based on the row's content.
SELECT ticket_id,
AI_CLASSIFY(body, ['billing', 'technical', 'account']):labels[0]::STRING AS category,
AI_SENTIMENT(body):categories[0]:sentiment::STRING AS overall_sentiment,
AI_SUMMARIZE(body) AS short_summary
FROM tickets;
| Function | What it adds |
|---|---|
AI_CLASSIFY | Category from a list of at least two; output_mode 'multi' allows several labels |
AI_SENTIMENT | An overall sentiment, plus optional aspects such as "price"; values are positive, negative, neutral, mixed, unknown |
AI_SUMMARIZE | Short summary of one text |
AI_EMBED | A VECTOR for search or clustering |
Aggregate versions work across many rows: AI_SUMMARIZE_AGG and AI_AGG summarize a whole column, such as all reviews for one product, and are not subject to the context window limit.
Augmentation
Augmentation creates new data to fill a gap. Examples are writing a product description from a few attributes, generating paraphrases to enlarge a small training set, or producing synthetic examples to test a pipeline. AI_COMPLETE does this work, and a low temperature gives repeatable output while a higher value gives variety.
The key risk is that generated content can be wrong. Mark it as generated, and do not mix it silently with source of record data.
Augmentation also describes adding context to a prompt: retrieving chunks from Cortex Search and placing them in the AI_COMPLETE prompt so the model has facts to use. That is the RAG pattern from earlier pages.
Transformation
Transformation keeps the meaning and changes the shape or language.
AI_TRANSLATE(text, source, target): an empty source string auto detects the language. Language codes such asen,fr,de,esandjaare used.AI_REDACT: masks sensitive information in text. Check the function page for the entity types it handles.AI_COMPLETEwith a schema: rewrites messy text as clean JSON with fixed fields, or normalizes addresses and names.AI_FILTER: keeps or drops rows by a natural language condition, returning a Boolean.
Picking the right function
| Scenario | Function |
|---|---|
| Invoice PDFs to a table of invoice number and total | AI_EXTRACT |
| Call recordings to text | AI_TRANSCRIBE |
| Tag each ticket as billing or technical | AI_CLASSIFY |
| One summary for all reviews of a product | AI_SUMMARIZE_AGG |
| Spanish reviews to English before analysis | AI_TRANSLATE |
| Only keep rows that mention a safety problem | AI_FILTER |
| Write sample customer emails for a test set | AI_COMPLETE (augmentation) |
Common mistakes
Using AI_COMPLETE for classification when AI_CLASSIFY returns a controlled label. Free text is harder to store and join.
Calling a summary an extraction. A summary is a new text. Extraction returns source facts.
Looping AI_SUMMARIZE over rows to summarize a group. Use AI_SUMMARIZE_AGG.
Passing a single category to AI_CLASSIFY. It needs at least two unique values.
Generated augmentation data is not verified data. Do not use it as a source of truth for reports.
What to remember for the exam
- Extraction pulls what exists, enrichment adds attributes, augmentation generates new content, transformation changes form or language.
AI_EXTRACT,AI_PARSE_DOCUMENT,AI_TRANSCRIBEare the extraction set.AI_CLASSIFY,AI_SENTIMENT,AI_SUMMARIZEandAI_EMBEDenrich.AI_TRANSLATEandAI_REDACTtransform; the aggregate functions summarize groups of rows.- For most AI functions a failed row returns NULL and the query continues.
Check yourself
Which task is "tag each support ticket as billing or technical"?
Enrichment, done with
AI_CLASSIFY.Which function auto detects the source language while translating?
AI_TRANSLATEwith an empty string as the source language.How do you summarize all reviews for one product in a single value?
Use the aggregate function
AI_SUMMARIZE_AGGwith GROUP BY.
Topic 24 of 26 in Snowflake Gen AI Functions
Test yourself on Snowflake Gen AI Functions
The full Snowflake GES-C02 question bank has 585 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.