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,请执行以下操作:
登录 Snowsight。
In the navigation menu, select AI & ML » AI Studio. The Document Processing Playground appears among the other Studio functions.
To open the Document Processing Playground, select Open.
从暂存区上传文档¶
选择 Add from stage。
系统随即显示对话框。
选择包含文档的数据库、架构和暂存区。
选择要添加到 Playground 的文档文件。
备注
您最多可以选择 10 个文档。
选择 Open playground。
此时会出现 Playground。
Document Processing Playground 界面在右侧显示文档预览,在左侧显示提示区域,您可以在其中输入提示。
小技巧
要更改正在预览的文档,请选择文档名称,然后从列表中选择另一个文档。
Document Processing Playground 界面由以下选项卡组成:
Extraction:选择使用 时默认使用的角色和仓库。您可以通过提问从文档中提取信息的视图。
Markdown:选择使用 时默认使用的角色和仓库。通过该视图,您可以查看文档的 Markdown 表示形式。这是来自 AI_PARSE_DOCUMENT 的 LAYOUT 模式输出。
Text:选择使用 时默认使用的角色和仓库。通过该视图,您可以查看文档的文本表示形式。这是来自 AI_PARSE_DOCUMENT 的 OCR 模式输出。
通过提问提取信息¶
您可以提出问题以从文档中提取信息。
选择 Extraction 选项卡。
Select the extraction type:
To ask a question, select Ask.
To extract a list, select List.
To extract a table, select Extract table.
创建键和问题对,例如:
键:
company问题:
What is the name of the company?
要确认,请选择 Add Prompt。
预览文档的 Markdown 和文本版本¶
Markdown 和 Text 选项卡显示 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:
在界面的右上角,选择 Code Snippets。
选择代码段的语言:SQL 或 Python。
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) |
|
Microsoft Azure |
|
Google Cloud |
|
限制¶
AI_EXTRACT 和 AI_PARSE_DOCUMENT 函数的限制适用于 Document Processing Playground。有关更多信息,请参阅 AI_EXTRACT 和 。