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
In a nutshell
  • Extraction pulls what exists, enrichment adds attributes, augmentation generates new content, transformation changes form or language.
  • AI_EXTRACT, AI_PARSE_DOCUMENT, AI_TRANSCRIBE are the extraction set.
  • AI_CLASSIFY, AI_SENTIMENT, AI_SUMMARIZE and AI_EMBED enrich.

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.

TaskMeaningTypical functions
ExtractionPull existing facts out of text, files or audioAI_EXTRACT, AI_PARSE_DOCUMENT, AI_TRANSCRIBE
EnrichmentAdd a derived attribute to each recordAI_CLASSIFY, AI_SENTIMENT, AI_SUMMARIZE, AI_EMBED
AugmentationCreate new content or records that were not thereAI_COMPLETE for generated text or synthetic data
TransformationChange the form of data, not its meaningAI_TRANSLATE, AI_REDACT, AI_COMPLETE with structured output
Sourcefiles, text, audioextractFactsfields, tablesenrichLabelstopic, sentimentaugmentNew contentgeneratedtransformTargetclean, translated

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 with response and error. 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_COMPLETE with response_format: pulls fields from free text into a JSON schema you define.
Exam tip

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;
FunctionWhat it adds
AI_CLASSIFYCategory from a list of at least two; output_mode 'multi' allows several labels
AI_SENTIMENTAn overall sentiment, plus optional aspects such as "price"; values are positive, negative, neutral, mixed, unknown
AI_SUMMARIZEShort summary of one text
AI_EMBEDA 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 as en, fr, de, es and ja are used.
  • AI_REDACT: masks sensitive information in text. Check the function page for the entity types it handles.
  • AI_COMPLETE with 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

ScenarioFunction
Invoice PDFs to a table of invoice number and totalAI_EXTRACT
Call recordings to textAI_TRANSCRIBE
Tag each ticket as billing or technicalAI_CLASSIFY
One summary for all reviews of a productAI_SUMMARIZE_AGG
Spanish reviews to English before analysisAI_TRANSLATE
Only keep rows that mention a safety problemAI_FILTER
Write sample customer emails for a test setAI_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.

Watch out

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_TRANSCRIBE are the extraction set.
  • AI_CLASSIFY, AI_SENTIMENT, AI_SUMMARIZE and AI_EMBED enrich.
  • AI_TRANSLATE and AI_REDACT transform; 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_TRANSLATE with 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_AGG with 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.