Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Crea un generatore di riassunti dei documenti nella Google Cloud console
Puoi creare un processore di riassunti utilizzando Document AI per riepilogare i contenuti dei documenti. L'output può essere personalizzato in base a lunghezza e formato.
Ecco un esempio di output JSON dell'entità risultante:
{"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."}}
Procedura
In questa guida rapida, creerai un processore di riassunti dei documenti, caricherai un documento di esempio per l'elaborazione e creerai una versione personalizzata del processore per regolare la struttura del riassunto.
Per seguire le indicazioni dettagliate per questa attività direttamente nella Google Cloud console, fai clic su Procedura guidata:
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.
Utilizza la Google Cloud console per creare un processore per il generatore di riassunti. Per ulteriori informazioni, scopri come creare e gestire i processori.
Nella Google Cloud console, nella sezione Document AI, vai alla pagina Workbench.
Seleziona Carica documento di test e seleziona il documento appena scaricato.
Ora ti trovi nella pagina di Riepilogo. Puoi visualizzare il testo rilevato tramite OCR e il riassunto del documento.
Cambia Lunghezza e Formato impostandole rispettivamente su Moderata ed Elenco puntato, quindi seleziona Riscrivi e osserva i risultati.
Torna alla pagina Personalizza e crea.
Esegui il deployment della versione del processore
Se vuoi utilizzare impostazioni di riassunto specifiche durante l'elaborazione dei documenti con l'API, crea una versione del processore per queste impostazioni.
Le Impostazioni di riassunto hanno gli ultimi valori utilizzati nella pagina precedente.
Seleziona Crea nuova versione per creare una versione del processore con le Impostazioni di riassunto specificate.
Inserisci un nome per la versione del processore, ad esempio quickstart-moderate-bulleted, poi seleziona Crea versione.
Vai alla scheda Deployment e utilizzo per visualizzare lo stato del deployment. Il deployment richiede alcuni minuti.
Una volta completato il deployment della versione, puoi impostarla come versione predefinita oppure fornire l'ID versione durante l'elaborazione dei documenti con l'API.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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-----------"]]