Document Processing Playground

The Document Processing Playground provides a user interface for exploring the AI_EXTRACT and AI_PARSE_DOCUMENT functions. You can upload your own documents from stage, ask questions to extract information using AI_EXTRACT, and preview both the layout and OCR results generated by AI_PARSE_DOCUMENT. The playground lets you explore how the functions process your documents, and copy the corresponding code snippets for further use.

For more information, see AI_EXTRACT and Parsing documents with AI_PARSE_DOCUMENT.

Required privileges

Users must use a role that has been granted the SNOWFLAKE.CORTEX_USER database role. For information about granting this privilege, see Cortex LLM privileges.

Get started with the Document Processing Playground

To access the Document Processing Playground:

  1. Sign in to Snowsight.

  2. In the navigation menu, select AI & ML » AI Studio. The Document Processing Playground appears among the other Studio functions.

  3. To open the Document Processing Playground, select Open.

Upload your documents from a stage

  1. Select Add from stage.

    A dialog appears.

  2. Select the database, schema, and stage that contains your documents.

  3. Select the document files that you want to add to the playground.

    Note

    You can select up to 10 documents.

  4. Select Open playground.

    The playground appears.

The Document Processing Playground interface displays a preview of a document on the right and a prompt area on the left where you can enter prompts.

Tip

To change the document that you are previewing, select the document name, and then select another document from the list.

The Document Processing Playground interface consists of the following tabs:

  • Extraction: The view where you can ask questions to extract information from the document.

  • Markdown: The view where you can see the markdown representation of the document. It’s the LAYOUT mode output from AI_PARSE_DOCUMENT.

  • Text: The view where you can see the text representation of the document. It’s the OCR mode output from AI_PARSE_DOCUMENT.

Extract information by asking questions

You can ask questions to extract information from the document.

  1. Select the Extraction tab.

  2. Select the extraction type:

    • To ask a question, select Ask.

    • To extract a list, select List.

    • To extract a table, select Extract table.

  3. Create key and question pairs, for example:

    • Key: company

    • Question: What is the name of the company?

  4. To confirm, select Add Prompt.

Preview the markdown and text versions of the document

The Markdown and the Text tabs display the results of the AI_PARSE_DOCUMENT function.

  • To see the Layout mode results, select the Markdown tab.

  • To see the OCR mode results, select the Text tab.

Get the code snippets for further use

After you ask at least one question, the playground creates code snippets that use the AI_EXTRACT and AI_PARSE_DOCUMENT functions to process your documents. To preview and copy the code snippets:

  1. In the top right corner of the interface, select Code Snippets.

  2. Select the language of the code snippet: SQL or Python.

  3. To open the snippet in workspaces, select Open in Workspaces.

    A new workspace opens with the code snippet.

Regional availability

The Document Processing Playground is available in the following regions:

Cloud platform

Cloud region

Amazon Web Services (AWS)

  • US East (N. Virginia)

  • US East (Ohio)

  • US West (Oregon)

  • Canada (Central)

  • South America (Sao Paulo)

  • Europe (London)

  • EU (Stockholm)

  • EU (Ireland)

  • EU (Frankfurt)

  • Asia Pacific (Mumbai)

  • Asia Pacific (Tokyo)

  • Asia Pacific (Seoul)

  • Asia Pacific (Sydney)

  • Asia Pacific (Jakarta)

Microsoft Azure

  • East US 2 (Virginia)

  • West US 2 (Washington)

  • South Central US (Texas)

  • Canada Central (Toronto)

  • UK South (London)

  • North Europe (Ireland)

  • West Europe (Netherlands)

  • Southeast Asia (Singapore)

  • UAE North (Dubai)

  • Australia East (New South Wales)

  • Central India (Pune)

  • Japan East (Tokyo)

Google Cloud

  • US East4 (N. Virginia)

  • US Central1 (Iowa)

  • Europe West2 (London)

  • Europe West3 (Frankfurt)

  • Europe West4 (Netherlands)

Limitations

Limitations of the AI_EXTRACT and AI_PARSE_DOCUMENT functions apply to the Document Processing Playground. For more information, see AI_EXTRACT and Parsing documents with AI_PARSE_DOCUMENT.