프로세서 버전의 평가 세부정보 가져오기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
완료된 평가의 평가 세부정보를 가져옵니다.
더 살펴보기
이 코드 샘플이 포함된 자세한 문서는 다음을 참조하세요.
코드 샘플
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis content provides instructions and a code sample for retrieving evaluation details of a completed Document AI evaluation.\u003c/p\u003e\n"],["\u003cp\u003eThe code sample, written in Python, uses the Document AI client library to get evaluation data, such as the creation time and document counters.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to Document AI requires setting up Application Default Credentials, as detailed in the linked documentation.\u003c/p\u003e\n"],["\u003cp\u003eThe evaluation information obtained includes the number of input, invalid, failed, and evaluated documents as well as a timestamp for when the evaluation was created.\u003c/p\u003e\n"],["\u003cp\u003eFor further exploration, the Document AI documentation provides a comprehensive overview on evaluating performance, and the Google Cloud sample browser allows you to search for additional code samples.\u003c/p\u003e\n"]]],[],null,["# Get evaluation details for a processor version\n\nGet evaluation details for a completed evaluation.\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 # evaluation_id = 'YOUR_EVALUATION_ID'\n\n\n def get_evaluation_sample(\n project_id: str,\n location: str,\n processor_id: str,\n processor_version_id: str,\n evaluation_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 evaluation\n # e.g. `projects/{project_id}/locations/{location}/processors/{processor_id}/processorVersions/{processor_version_id}`\n evaluation_name = 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_evaluation_path(\n project_id, location, processor_id, processor_version_id, evaluation_id\n )\n # Make GetEvaluation request\n evaluation = 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_get_evaluation(name=evaluation_name)\n\n create_time = evaluation.create_time\n document_counters = evaluation.document_counters\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\"Create Time: {create_time}\")\n print(f\"Input Documents: {document_counters.input_documents_count}\")\n print(f\"\\tInvalid Documents: {document_counters.invalid_documents_count}\")\n print(f\"\\tFailed Documents: {document_counters.failed_documents_count}\")\n print(f\"\\tEvaluated Documents: {document_counters.evaluated_documents_count}\")\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)."]]