Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Crea un generador de resúmenes de documentos en la consola de Google Cloud
Puedes crear un procesador de resúmenes con Document AI para resumir el
contenido de los documentos. El resultado se puede personalizar según la longitud y el formato.
Este es un ejemplo de un resultado JSON de la entidad 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."}}
Procedimiento
En esta guía de inicio rápido, crearás un procesador de resúmenes de documentos, subirás un documento de muestra
para procesarlo y crearás una versión personalizada del procesador para ajustar la estructura
del resumen.
Para seguir la guía paso a paso sobre esta tarea directamente en la consola Google Cloud , haz clic en Guiarme:
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.
Selecciona
Subir documento de prueba y selecciona
el documento que acabas de descargar.
Ahora te encuentras en la página Resumen. Puedes ver las anotaciones de texto y documentos detectadas por el OCR.
Ajusta la configuración de Longitud y formato a Moderada y Con viñetas respectivamente y, luego, selecciona Reescribir y observa los resultados.
Vuelve a la página Personalizar y compilar.
Implementa la versión del procesador
Si quieres usar una configuración de resumen específica cuando procesas documentos con la API, crea una versión del procesador para esa configuración.
La Configuración de resúmenes se establece con los últimos valores que usaste en la página anterior.
Selecciona Crear versión nueva para crear una versión del procesador con la Configuración de resúmenes especificada.
Escribe un nombre para la versión del procesador, como quickstart-moderate-bulleted, y selecciona Crear versión.
Ve a la pestaña Implementar y usar para ver el estado de la implementación. La implementación tarda unos minutos.
Cuando se implementa la versión, puedes establecerla como la Versión predeterminada o puedes proporcionar el ID de la versión cuando proceses documentos con la API.
Para usar la API de Document AI, sigue estos pasos:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (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-----------"]]