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.

有关更多信息,请参阅 AI_EXTRACT 和 。

所需权限

用户必须使用已被授予 SNOWFLAKE.CORTEX_USER 数据库角色 的角色。有关授予此权限的信息,请参阅 Cortex LLM privileges

开始使用 Document Processing Playground

要访问 Document Processing Playground,请执行以下操作:

  1. 登录 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.

从暂存区上传文档

  1. 选择 Add from stage

    系统随即显示对话框。

  2. 选择包含文档的数据库、架构和暂存区。

  3. 选择要添加到 Playground 的文档文件。

    备注

    您最多可以选择 10 个文档。

  4. 选择 Open playground

    此时会出现 Playground。

Document Processing Playground 界面在右侧显示文档预览,在左侧显示提示区域,您可以在其中输入提示。

小技巧

要更改正在预览的文档,请选择文档名称,然后从列表中选择另一个文档。

Document Processing Playground 界面由以下选项卡组成:

  • Extraction:选择使用 时默认使用的角色和仓库。您可以通过提问从文档中提取信息的视图。

  • Markdown:选择使用 时默认使用的角色和仓库。通过该视图,您可以查看文档的 Markdown 表示形式。这是来自 AI_PARSE_DOCUMENT 的 LAYOUT 模式输出。

  • Text:选择使用 时默认使用的角色和仓库。通过该视图,您可以查看文档的文本表示形式。这是来自 AI_PARSE_DOCUMENT 的 OCR 模式输出。

通过提问提取信息

您可以提出问题以从文档中提取信息。

  1. 选择 Extraction 选项卡。

  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. 创建键和问题对,例如:

    • 键:company

    • 问题:What is the name of the company?

  4. 要确认,请选择 Add Prompt

预览文档的 Markdown 和文本版本

MarkdownText 选项卡显示 AI_PARSE_DOCUMENT 函数的结果。

  • 要查看布局模式结果,请选择 Markdown 选项卡。

  • 要查看 OCR 模式结果,请选择 Text 选项卡。

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. 在界面的右上角,选择 Code Snippets

  2. 选择代码段的语言:SQL 或 Python。

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

    A new workspace opens with the code snippet.

区域可用性

The Document Processing Playground is available in the following regions:

云平台

云区域

Amazon Web Services (AWS)

  • US 东部(弗吉尼亚北部)

  • US 东部(俄亥俄州)

  • US 西部(俄勒冈州)

  • 加拿大(中部)

  • 南美(圣保罗)

  • 欧洲(伦敦)

  • EU(斯德哥尔摩)

  • EU(爱尔兰)

  • EU(法兰克福)

  • 亚太地区(孟买)

  • 亚太地区(东京)

  • 亚太地区(首尔)

  • 亚太地区(悉尼)

  • 亚太地区(雅加达)

Microsoft Azure

  • US 东部 2(弗吉尼亚州)

  • US 西部 2(华盛顿)

  • US 中南部(得克萨斯州)

  • 加拿大中部(多伦多)

  • UK 南部(伦敦)

  • 欧洲北部(爱尔兰)

  • 欧洲西部(荷兰)

  • 东南亚(新加坡)

  • UAE 北部(迪拜)

  • 澳大利亚东部(新南威尔士州)

  • 印度中部(浦那)

  • 日本东部(东京)

Google Cloud

  • US 东部 4(弗吉尼亚州北部)

  • US 中部 1(爱荷华州)

  • 欧洲西部 2(伦敦)

  • 欧洲西部 3(法兰克福)

  • 欧洲西部 4(荷兰)

限制

AI_EXTRACT 和 AI_PARSE_DOCUMENT 函数的限制适用于 Document Processing Playground。有关更多信息,请参阅 AI_EXTRACT 和 。

语言: 中文