고정 레이아웃 사용 사례의 경우 학습 문서 3개와 테스트 문서 3개만으로 성능이 우수한 모델을 학습할 수 있습니다. W9, 1040, ACORD, 설문조사, 설문지와 같은 템플릿 문서 유형의 개발 속도를 높이고 프로덕션까지의 시간을 단축합니다.
데이터 세트 구성
프로세서 버전을 학습시키거나 업트레이닝하거나 평가하려면 문서 데이터 세트가 필요합니다.
Document AI 프로세서는 인간과 마찬가지로 예시에서 학습합니다. 데이터 세트는 성능 측면에서 프로세서 안정성을 개선합니다.
학습 데이터 세트
모델과 정확성을 개선하려면 문서에서 데이터 세트를 학습합니다. 모델은 정답이 있는 문서로 구성됩니다. 새 모델을 학습시키려면 문서가 3개 이상 필요합니다.
테스트 데이터 세트
테스트 데이터 세트는 모델에서 F1 점수 (정확성)를 생성하는 데 사용됩니다. 정답이 포함된 문서로 구성됩니다. 모델이 얼마나 정확한지 확인하기 위해 정답을 사용하여 모델의 예측 (모델에서 추출한 필드)을 올바른 답변과 비교합니다. 테스트 데이터 세트에는 문서가 3개 이상 있어야 합니다.
데이터 세트 위치를 설정합니다. 기본 옵션 폴더 (Google 관리)를 선택합니다. 이는 프로세서를 만든 직후에 자동으로 실행될 수 있습니다.
Build(빌드) 탭으로 이동하여 자동 라벨 지정이 사용 설정된 문서 가져오기를 선택합니다. 일반적으로 템플릿 기반 학습의 품질은 필요한 최소 3개보다 더 많은 문서를 추가해도 개선되지 않습니다. 더 많은 이미지를 추가하는 대신 소수의 이미지를 매우 정확하게 라벨링하는 데 집중하세요.
경계 상자를 확장합니다. 템플릿 모드의 이러한 상자는 위의 예와 같이 표시됩니다. 최적의 결과를 얻기 위해 권장사항에 따라 경계 상자를 확장합니다.
모델을 학습시킵니다.
새 버전 학습을 선택합니다.
프로세서 버전의 이름을 지정합니다.
고급 옵션 표시로 이동하여 템플릿 기반 모델 접근 방식을 선택합니다.
평가
평가 및 테스트로 이동합니다.
방금 학습한 버전을 선택한 다음 전체 평가 보기를 선택합니다.
이제 전체 문서 및 각 필드의 F1, 정밀도, 재현율과 같은 측정항목이 표시됩니다.
1. 성능이 프로덕션 목표를 충족하는지 결정합니다. 충족하지 않으면 학습 및 테스트 세트를 재평가합니다.
새 버전을 기본값으로 설정합니다.
버전 관리로 이동합니다.
선택하여 설정 메뉴를 표시한 다음 기본값으로 설정을 선택합니다.
이제 모델이 배포되고 이 프로세서로 전송되는 문서에서 맞춤 버전을 사용합니다. 모델의 성능을 평가하여 (방법에 관한 자세한 내용) 추가 학습이 필요한지 확인하려 합니다.
평가 참조
평가 엔진은 일치검색 또는 유사 검색을 모두 실행할 수 있습니다.
정확한 일치의 경우 추출된 값이 실제 값과 정확하게 일치해야 하며 그렇지 않으면 누락으로 집계됩니다.
대소문자 차이와 같은 약간의 차이가 있는 퍼지 일치 추출도 일치로 간주됩니다. 평가 화면에서 변경할 수 있습니다.
기반 모델을 사용한 자동 라벨 지정
기반 모델은 다양한 문서 유형의 필드를 정확하게 추출할 수 있지만, 특정 문서 구조에 대한 모델의 정확성을 개선하기 위해 추가 학습 데이터를 제공할 수도 있습니다.
Document AI는 사용자가 정의한 라벨 이름과 이전 주석을 사용하여 자동 라벨 지정을 통해 대규모 문서에 더 쉽고 빠르게 라벨을 지정할 수 있습니다.
맞춤 프로세서를 만든 후 시작하기 탭으로 이동합니다.
새 필드 만들기를 선택합니다.
Build 탭으로 이동한 다음 문서 가져오기를 선택합니다.
문서의 경로와 문서를 가져올 세트를 선택합니다. 자동 라벨 지정 체크박스를 선택하고 기반 모델을 선택합니다.
빌드 탭에서 데이터 세트 관리를 선택합니다. 가져온 문서가 표시됩니다. 문서 중 하나를 선택합니다.
모델의 예측이 보라색으로 강조 표시됩니다. 모델에서 예측한 각 라벨을 검토하여 올바른지 확인해야 합니다. 누락된 필드가 있는 경우 해당 필드도 추가해야 합니다.
문서가 검토되면 라벨이 지정된 것으로 표시를 선택합니다.
이제 모델에서 문서를 사용할 수 있습니다. 문서가 테스트 또는 학습 세트에 있는지 확인합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-18(UTC)"],[[["\u003cp\u003eTemplate-based extraction allows for training a high-performing model with a minimum of three training and three test documents, ideal for fixed-layout documents like W9s and questionnaires.\u003c/p\u003e\n"],["\u003cp\u003eA document dataset, comprising documents with ground-truth data, is essential for training, up-training, and evaluating a processor version, as the processor learns from these examples.\u003c/p\u003e\n"],["\u003cp\u003eFor template mode labeling, it is recommended to draw bounding boxes around the entire expected data area within a document, even if the field is empty in the training document, unlike model-based training.\u003c/p\u003e\n"],["\u003cp\u003eWhen building a custom extractor, auto-labeling can be enabled during document import, and it is advised to focus on accurately labeling a small set of documents rather than adding more documents during template-based training.\u003c/p\u003e\n"],["\u003cp\u003eThe foundation model allows for auto-labeling, which can be improved in accuracy and performance with the addition of training data with descriptive label names, while ensuring that all fields are accurate.\u003c/p\u003e\n"]]],[],null,["# Template-based extraction\n=========================\n\nYou can train a high-performing model with as little as three training and three test\ndocuments for fixed-layout use cases. Accelerate development and reduce time to\nproduction for templated document types like W9, 1040, ACORD, surveys, and questionnaires.\n\n\nDataset configuration\n---------------------\n\nA document dataset is required to train, up-train, or evaluate a processor version. Document AI processors learn from examples, just like humans. Dataset fuels processor stability in terms of performance. \n\n### Train dataset\n\nTo improve the model and its accuracy, train a dataset on your documents. The model is made up of documents with ground-truth. You need a minimum of three documents to train a new model. Ground-truth is the correctly labeled data, as determined by humans.\n\n### Test dataset\n\nThe test dataset is what the model uses to generate an F1 score (accuracy). It is made up of documents with ground-truth. To see how often the model is right, the ground truth is used to compare the model's predictions (extracted fields from the model) with the correct answers. The test dataset should have at least three documents.\n\n\u003cbr /\u003e\n\nBefore you begin\n----------------\n\nIf not already done, enable:\n\n- [Billing](/document-ai/docs/setup#billing)\n- [Document AI API](/document-ai/docs/setup)\n\nTemplate-mode labeling best practices\n-------------------------------------\n\nProper labeling is one of the most important steps to achieving high accuracy.\nTemplate mode has some unique labeling methodology that differs from other training modes:\n\n- Draw bounding boxes around the entire area you expect data to be in (per label) within a document, even if the label is empty in the training document you're labeling.\n- You may label empty fields for template-based training. Don't label empty fields for model-based training.\n\n| **Recommended.** Labeling example for template-based training to extract the top section of a 1040.\n| **Not recommended.** Labeling example for template-based training to extract the top section of a 1040. This is the labeling technique you should use for model-based training for documents with layout variation across documents.\n\nBuild and evaluate a custom extractor with template mode\n--------------------------------------------------------\n\n1. Create a custom extractor. [Create a processor](/document-ai/docs/workbench/build-custom-processor#create_a_processor)\n and [define fields](/document-ai/docs/workbench/build-custom-processor#define_processor_fields)\n you want to extract following [best practices](/document-ai/docs/workbench/label-documents#name-fields),\n which is important because it impacts extraction quality.\n\n2. Set dataset location. Select the default option folder (Google-managed). This\n might be done automatically shortly after creating the processor.\n\n3. Navigate to the **Build** tab and select **Import documents** with auto-labeling\n enabled. Adding more documents than the minimum of three needed typically doesn't improve quality for\n template-based training. Instead of adding more, focus on labeling a small set very accurately.\n\n | **Note:** You can experiment by increasing the training set size if you observe template variations in your dataset. Try to include at least three training documents per variation. At least three training documents, three test documents, and three schema labels are required per set.\n4. Extend bounding boxes. These boxes for template mode should look like the preceding\n examples. Extend the bounding boxes, following the best practices for the optimal result.\n\n5. Train model.\n\n 1. Select **Train new version**.\n 2. Name the processor version.\n 3. Go to **Show advanced options** and select the template-based model approach.\n\n | **Note:** It takes some time for the training to complete.\n6. Evaluation.\n\n 1. Go to **Evaluate \\& test**.\n 2. Select the version you just trained, then select **View Full Evaluation**.\n\n You now see metrics such as F1, precision, and recall for the entire document and each field.\n 1. Decide if performance meets your production goals, and if not, reevaluate training and testing sets.\n7. Set a new version as the default.\n\n 1. Navigate to **Manage versions**.\n 2. Select to see the settings menu, then mark **Set as default**.\n\n Your model is now deployed and documents sent to this processor use your custom\n version. You want to evaluate the model's performance ([more details](/document-ai/docs/workbench/evaluate)\n on how to do that) to check if it requires further training.\n\nEvaluation reference\n--------------------\n\nThe evaluation engine can do both exact match or [fuzzy matching](/document-ai/docs/workbench/evaluate#fuzzy_matching).\nFor an exact match, the extracted value must exactly match the ground truth or is counted as a miss.\n\nFuzzy matching extractions that had slight differences such as capitalization\ndifferences still count as a match. This can be changed at the **Evaluation** screen.\n\nAuto-labeling with the foundation model\n---------------------------------------\n\nThe foundation model can accurately extract fields for a variety of document types,\nbut you can also provide additional training data to improve the accuracy of the\nmodel for specific document structures.\n\nDocument AI uses the label names you define and previous annotations to make\nit quicker and easier to label documents at scale with auto-labeling.\n\n1. After creating a custom processor, go to the **Get started** tab.\n2. Select **Create New Field**.\n\n | **Note:** The label name with the foundation model can greatly affect model accuracy and performance. Be sure to give a descriptive name.\n\n3. Navigate to the **Build** tab and then select **Import documents**.\n\n4. Select the path of the documents and which set the documents should be imported\n into. Check the auto-labeling checkbox and select the foundation model.\n\n5. In the **Build** tab, select **Manage dataset**. You should see your imported\n documents. Select one of your documents.\n\n6. You see the predictions from the model highlighted in purple, you need to review\n each label predicted by the model and ensure it's correct. If there are missing\n fields, you need to add those as well.\n\n | **Note:** It's important that all fields are as accurate as possible or model performance is going to be affected. For more [details on labeling](/document-ai/docs/workbench/label-documents).\n\n7. Once the document has been reviewed, select **Mark as labeled**.\n\n8. The document is now ready to be used by the model. Make sure the document is\n in either the testing or training set."]]