Membuat fitur ringkasan dokumen di konsol Google Cloud
Anda dapat membuat pemroses ringkasan menggunakan Document AI untuk meringkas konten dokumen. Output dapat disesuaikan berdasarkan panjang dan format.
Berikut adalah beberapa contoh output JSON dari entity yang dihasilkan:
{
"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."
}
}
Prosedur
Dalam panduan memulai ini, Anda akan membuat pemroses peringkas dokumen, mengupload dokumen contoh untuk diproses, dan membuat versi pemroses kustom untuk menyesuaikan struktur ringkasan.
Untuk mengikuti panduan langkah demi langkah tugas ini langsung di Google Cloud konsol, klik Pandu saya:
Sebelum memulai
- 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.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Document AI, Cloud Storage APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Document AI, Cloud Storage APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles. Di konsol Google Cloud , di bagian Document AI, buka halaman Workbench.
Untuk Summarizer, pilih
Buat prosesor .Di menu Buat pemroses, masukkan nama untuk pemroses Anda, misalnya
quickstart-summarizer
.Pilih wilayah yang terdekat dengan Anda.
Pilih Create.
Pilih tab
Sesuaikan & buat untuk bereksperimen dengan prosesor.-
File ini adalah file PDF yang berisi halaman Wikipedia untuk Superkonduktivitas.
Pilih
Upload Test Document , lalu pilih dokumen yang baru saja Anda download.Anda sekarang berada di halaman Ringkasan. Anda dapat melihat teks yang terdeteksi OCR dan ringkasan dokumen.
Sesuaikan setelan
Panjang dan Format ke Sedang dan Berbutir, lalu pilih Tulis ulang dan amati hasilnya.Kembali ke halaman Sesuaikan & buat.
Setelan ringkasan ditetapkan ke nilai terakhir yang Anda gunakan di halaman sebelumnya.Pilih
Buat Versi Baru untuk membuat versi prosesor dengan Setelan ringkasan yang ditentukan.Masukkan nama untuk versi pemroses, misalnya
quickstart-moderate-bulleted
, lalu pilih Buat Versi.Buka tab
Deploy & Use untuk melihat status deployment. Deployment memerlukan waktu beberapa menit.Saat versi di-deploy, Anda dapat menetapkannya sebagai
Versi default , atau Anda dapat memberikan ID versi saat memproses dokumen dengan API.Untuk menggunakan Document AI API:
- Ikuti contoh kode di mengirim permintaan pemrosesan untuk menggunakan pemrosesan online dan batch.
- Lihat Kuota dan batas untuk mengetahui jumlah halaman yang didukung untuk pemrosesan online dan batch.
- Ikuti contoh kode di Menangani respons pemrosesan untuk mendapatkan respons ringkasan dari prosesor.
- Ikuti contoh kode di mengirim permintaan pemrosesan untuk menggunakan pemrosesan online dan batch.
Membuat pemroses peringkas
Gunakan konsol Google Cloud untuk membuat pemroses peringkas. Lihat membuat dan mengelola pemroses untuk mengetahui informasi selengkapnya.
Prosesor Anda kini telah dibuat.
Prosesor Pengujian
Anda berada di halaman Processor overview dari pemroses yang baru saja Anda buat.
Men-deploy versi pemroses
Jika Anda ingin menggunakan setelan ringkasan tertentu saat memproses dokumen dengan API, buat versi pemroses untuk setelan tersebut.
Anda telah berhasil menggunakan Document AI untuk mengekstrak teks dari dokumen dan meringkasnya.
Pembersihan
Agar akun Google Cloud Anda tidak dikenai biaya untuk resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.
Untuk menghindari tagihan yang tidak perlu, gunakan Google Cloud console untuk menghapus prosesor dan project jika Anda tidak memerlukannya. Google Cloud