Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Criar um resumidor de documentos no console do Google Cloud
É possível criar um processador de resumo usando a Document AI para resumir o
conteúdo dos documentos. A saída pode ser personalizada com base em comprimento e formato.
Confira um exemplo de saída JSON da entidade resultante:
{"type":"summary","mentionText":" Superconductivity is a phenomenon in which a material conducts electricity with no resistance. It was discovered in 1911 by Dutch physicist Heike Kamerlingh Onnes. In 1986, a new class of materials was discovered that can superconduct at much higher temperatures. These materials are called high-temperature superconductors. They have the potential to revolutionize the way we use electricity. However, high-temperature superconductors are still very expensive to produce. Scientists are working on ways to make them more affordable.","normalizedValue":{"text":" Superconductivity is a phenomenon in which a material conducts electricity with no resistance. It was discovered in 1911 by Dutch physicist Heike Kamerlingh Onnes. In 1986, a new class of materials was discovered that can superconduct at much higher temperatures. These materials are called high-temperature superconductors. They have the potential to revolutionize the way we use electricity. However, high-temperature superconductors are still very expensive to produce. Scientists are working on ways to make them more affordable."}}
Procedimento
Neste guia de início rápido, você vai criar um processador de resumo de documentos, fazer upload de um documento
de exemplo para processamento e criar uma versão do processador personalizada para ajustar a estrutura
do resumo.
Para seguir as instruções detalhadas desta tarefa diretamente no console do
Google Cloud , clique em Orientação:
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[[["\u003cp\u003eDocument AI allows users to create a summarizer processor for summarizing document content, with customizable output length and format.\u003c/p\u003e\n"],["\u003cp\u003eUsers can test the summarizer by uploading a sample document, then adjust the length and format settings like 'Moderate' and 'Bulleted' to modify the summary output.\u003c/p\u003e\n"],["\u003cp\u003eA custom processor version with specific summarization settings can be created and deployed to process documents through the API.\u003c/p\u003e\n"],["\u003cp\u003eThe Document AI API enables online and batch processing, and provides code samples for sending requests and handling summarization responses.\u003c/p\u003e\n"],["\u003cp\u003eTo avoid unnecessary charges, users should delete the processor and project via the Google Cloud console when finished.\u003c/p\u003e\n"]]],[],null,["# Build a document summarizer in the Google Cloud console\n=======================================================\n\nYou can create a summarizer processor using Document AI to summarize the\ncontent of documents. The output can be customized based on [length](/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.processorVersions#Length) and [format](/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.processorVersions#Format).\n\nHere is some sample JSON output from the resulting entity: \n\n {\n \"type\": \"summary\",\n \"mentionText\": \" Superconductivity is a phenomenon in which a material conducts\n electricity with no resistance. It was discovered in 1911 by Dutch physicist Heike\n Kamerlingh Onnes. In 1986, a new class of materials was discovered that can superconduct\n at much higher temperatures. These materials are called high-temperature superconductors.\n They have the potential to revolutionize the way we use electricity. However,\n high-temperature superconductors are still very expensive to produce. Scientists\n are working on ways to make them more affordable.\",\n \"normalizedValue\": {\n \"text\": \" Superconductivity is a phenomenon in which a material conducts\n electricity with no resistance. It was discovered in 1911 by Dutch physicist\n Heike Kamerlingh Onnes. In 1986, a new class of materials was discovered that\n can superconduct at much higher temperatures. These materials are called\n high-temperature superconductors. They have the potential to revolutionize\n the way we use electricity. However, high-temperature superconductors are\n still very expensive to produce. Scientists are working on ways to make\n them more affordable.\"\n }\n }\n\nProcedure\n---------\n\nIn this quickstart, you create a document summarizer processor, upload a sample\ndocument for processing, and create a custom processor version to adjust the summary\nstructure.\n\n*** ** * ** ***\n\nTo follow step-by-step guidance for this task directly in the\nGoogle Cloud console, click **Guide me**:\n\n[Guide me](https://console.cloud.google.com/ai/document-ai?tutorial=document-ai--documentai-workbench_summarizer_console)\n\n*** ** * ** ***\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Document AI, Cloud Storage APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=documentai.googleapis.com,storage.googleapis.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Document AI, Cloud Storage APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=documentai.googleapis.com,storage.googleapis.com)\n\nCreate a summarizer processor\n-----------------------------\n\nUse the Google Cloud console to create a summarizer processor. See [creating and managing processors](/document-ai/docs/create-processor) for more information.\n\n1. In the Google Cloud console, in the Document AI section, go to the **Workbench** page.\n\n\n [Workbench](https://console.cloud.google.com/ai/document-ai/workbench)\n2. For **Summarizer** , select\n **Create processor**.\n\n\n3. In the **Create processor** menu, enter a name for your processor, such as `quickstart-summarizer`.\n\n4. Select the region closest to you.\n\n5. Select **Create**.\n\nYour processor has now been created.\n\nTest Processor\n--------------\n\nYou are on the **Processor overview** page of the processor you just created.\n\n\n1. Select on the **Customize \\& build** tab to experiment with the processor.\n\n\n2. [Download a sample document](https://storage.googleapis.com/cloud-samples-data/documentai/Summarizer/Superconductivity.pdf)\n\n It is a PDF file containing the [Wikipedia page for Superconductivity](https://en.wikipedia.org/wiki/Superconductivity).\n3. Select\n **Upload Test Document** and select the document you just downloaded.\n\n4. You are now on the **Summary** page. You can view the OCR detected text and document summarization.\n\n\n5. Adjust the **Length and Format** settings to **Moderate** and **Bulleted** respectively, then select **Rewrite** and observe the results.\n\n6. Go back to the **Customize \\& build** page.\n\nDeploy processor version\n------------------------\n\nIf you want to use specific summarization settings when processing documents with the API, create a processor version for those settings.\n\n1. The **Summarization settings** are set to the last values you used on the previous page.\n\n2. Select on **Create New Version** to create a processor version with the specified **Summarization settings**.\n\n3. Enter a name for the processor version, such as `quickstart-moderate-bulleted`, and select **Create Version**.\n\n4. Go to the **Deploy \\& Use** tab to view the deployment status. Deployment takes a few minutes.\n\n5. When the version is deployed, you can set it as the **Default version**, or you can provide the version ID when processing documents with the API.\n\n6. To use the Document AI API:\n\n - Follow the code samples in [send a processing request](/document-ai/docs/send-request) to use online and batch processing.\n - Refer to [Quotas and limits](/document-ai/quotas#processor_limits) for the number of pages supported for online and batch processing.\n - Follow the code samples in [Handle the processing response](/document-ai/docs/handle-response#summarization) to get the summarization response from the processor.\n\nYou have successfully used Document AI to extract text from a document and summarize it.\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\nTo avoid unnecessary Google Cloud charges, use the\n[Google Cloud console](https://console.cloud.google.com/) to delete your processor and [project](https://console.cloud.google.com/cloud-resource-manager) if you do not need\nthem.\n\nWhat's next\n-----------"]]