Membuat daftar evaluasi untuk versi pemroses
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mencantumkan metrik evaluasi untuk versi pemroses
Mempelajari lebih lanjut
Untuk dokumentasi mendetail yang menyertakan contoh kode ini, lihat artikel berikut:
Contoh kode
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis content provides instructions and a code sample for listing evaluation metrics for a specific processor version in Google Cloud's Document AI.\u003c/p\u003e\n"],["\u003cp\u003eThe code sample is written in Python and utilizes the Document AI Python API, which requires proper authentication setup through Application Default Credentials.\u003c/p\u003e\n"],["\u003cp\u003eThe sample involves setting up a client, defining the resource name for the processor version, and then using the \u003ccode\u003elist_evaluations\u003c/code\u003e method to retrieve and print evaluation information.\u003c/p\u003e\n"],["\u003cp\u003eIt also directs users to documentation on how to set up authentication for a local environment and the specific details about evaluation data.\u003c/p\u003e\n"],["\u003cp\u003eA link to the Google Cloud sample browser is provided to search for additional code samples for other Google Cloud products.\u003c/p\u003e\n"]]],[],null,["# List evaluations for a processor version\n\nList evaluation metrics for a processor version\n\nExplore further\n---------------\n\n\nFor detailed documentation that includes this code sample, see the following:\n\n- [Evaluate performance](/document-ai/docs/evaluate)\n\nCode sample\n-----------\n\n### Python\n\n\nFor more information, see the\n[Document AI Python API\nreference documentation](/python/docs/reference/documentai/latest).\n\n\nTo authenticate to Document AI, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n\n from google.api_core.client_options import ClientOptions\n from google.cloud import documentai # type: ignore\n\n # TODO(developer): Uncomment these variables before running the sample.\n # project_id = 'YOUR_PROJECT_ID'\n # location = 'YOUR_PROCESSOR_LOCATION' # Format is 'us' or 'eu'\n # processor_id = 'YOUR_PROCESSOR_ID' # Create processor before running sample\n # processor_version_id = 'YOUR_PROCESSOR_VERSION_ID'\n\n\n def list_evaluations_sample(\n project_id: str, location: str, processor_id: str, processor_version_id: str\n ) -\u003e None:\n # You must set the api_endpoint if you use a location other than 'us', e.g.:\n opts = ClientOptions(api_endpoint=f\"{location}-documentai.googleapis.com\")\n\n client = documentai.https://cloud.google.com/python/docs/reference/documentai/latest/google.cloud.documentai_v1.services.document_processor_service.DocumentProcessorServiceClient.html(client_options=opts)\n\n # The full resource name of the processor version\n # e.g. `projects/{project_id}/locations/{location}/processors/{processor_id}/processorVersions/{processor_version_id}`\n parent = client.https://cloud.google.com/python/docs/reference/documentai/latest/google.cloud.documentai_v1.services.document_processor_service.DocumentProcessorServiceClient.html#google_cloud_documentai_v1_services_document_processor_service_DocumentProcessorServiceClient_processor_version_path(\n project_id, location, processor_id, processor_version_id\n )\n\n evaluations = client.https://cloud.google.com/python/docs/reference/documentai/latest/google.cloud.documentai_v1.services.document_processor_service.DocumentProcessorServiceClient.html#google_cloud_documentai_v1_services_document_processor_service_DocumentProcessorServiceClient_list_evaluations(parent=parent)\n\n # Print the Evaluation Information\n # Refer to https://cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.processorVersions.evaluations\n # for more information on the available evaluation data\n print(f\"Evaluations for Processor Version {parent}\")\n\n for evaluation in evaluations:\n print(f\"Name: {evaluation.name}\")\n print(f\"\\tCreate Time: {evaluation.create_time}\\n\")\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=documentai)."]]