이 페이지에서는 항목 추출 모델을 학습시키기 위해 Vertex AI 데이터 세트에서 사용할 텍스트 데이터를 준비하는 방법을 설명합니다.
항목 추출 학습 데이터는 모델에서 식별하려는 항목 유형을 식별하는 라벨로 주석이 추가된 문서로 구성됩니다. 예를 들어 법률 문서 또는 특허 서류에서 특별한 용어를 식별하기 위해 항목 추출 모델을 만들 수 있습니다. 주석은 라벨을 지정하는 항목의 위치 및 라벨 자체를 지정합니다.
송장 또는 계약서와 같이 AutoML 모델을 학습시키기 위해 사용되는 데이터 세트에 대해 구조화된 또는 반구조적인 문서에 주석을 추가하는 경우 Vertex AI는 페이지의 주석 위치를 적합한 라벨에 기여하는 요소로 고려할 수 있습니다. 예를 들어 부동산 계약에는 계약 수락 날짜와 계약 실행 날짜가 모두 포함되어 있습니다. Vertex AI는 주석의 공간 위치를 기준으로 각 항목을 구분하는 방법을 학습할 수 있습니다.
데이터 요구사항
학습 문서는 최소 50개에서 최대 100,000개까지 제공해야 합니다.
추출하려는 항목에 주석을 추가하려면 최소 1개에서 최대 100개의 고유 라벨을 제공해야 합니다.
라벨을 사용하여 1개에서 10개 사이의 단어에 주석을 추가할 수 있습니다.
라벨 이름은 2~30자 사이여야 합니다.
JSON Lines 파일에 주석을 포함하거나 나중에 문서를 업로드한 후 Google Cloud Console을 사용하여 주석을 추가할 수 있습니다.
문서를 인라인으로 포함하거나 Cloud Storage 버킷에 있는 TXT 파일을 참조할 수 있습니다.
AutoML 모델 학습에 사용되는 텍스트 데이터를 위한 권장사항
다음 권장사항은 AutoML 모델 학습에 사용되는 데이터 세트에 적용됩니다.
각 라벨을 학습 데이터 세트에서 200회 이상 사용합니다.
모델에서 식별하려는 항목이 나올 때마다 여기에 주석을 추가합니다.
입력 파일
항목 추출의 입력 파일 유형은 JSON Lines여야 합니다. JSON Lines 파일의 형식, 필드 이름, 값 유형은 공개적으로 액세스할 수 있는 YAML 파일인 스키마 파일에 따라 결정됩니다.
다음 예시에서는 스키마를 사용하여 자체 JSON Lines 파일을 만드는 방법을 보여줍니다. 이 예시에는 가독성을 위해 줄바꿈을 사용했습니다. JSON 파일에서는 각 문서 뒤에만 줄바꿈을 사용하세요. dataItemResourceLabels 필드는 ml_use 등을 지정하며, 선택사항입니다.
[[["이해하기 쉬움","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-09-04(UTC)"],[],[],null,["# Prepare text training data for entity extraction\n\n| Starting on September 15, 2024, you can only customize classification, entity extraction, and sentiment analysis objectives by moving to Vertex AI Gemini prompts and tuning. Training or updating models for Vertex AI AutoML for Text classification, entity extraction, and sentiment analysis objectives will no longer be available. You can continue using existing Vertex AI AutoML Text models until June 15, 2025. For a comparison of AutoML text and Gemini, see [Gemini for AutoML text users](/vertex-ai/docs/start/automl-gemini-comparison). For more information about how Gemini offers enhanced user experience through improved prompting capabilities, see [Introduction to tuning](/vertex-ai/generative-ai/docs/models/tune-gemini-overview). To get started with tuning, see [Model tuning for Gemini text models](/vertex-ai/generative-ai/docs/models/tune_gemini/tune-gemini-learn)\n\nThis page describes how to prepare text data for use in a Vertex AI\ndataset to train a entity extraction model.\n\nEntity extraction training data consists of documents that are annotated with\nthe labels that identify the types of entities that you want your model to\nidentify. For example, you might create an entity extraction model to identify\nspecialized terminology in legal documents or patents. Annotations specify\nthe locations of the entities that you're labeling and the labels themselves.\n\nIf you're annotating structured or semi-structure documents for a dataset used\nto train AutoML models, such as invoices or contracts,\nVertex AI can consider an annotation's\nposition on the page as a factor contributing to its proper label. For\nexample, a real estate contract has both an acceptance date and a closing\ndate. Vertex AI can learn to distinguish between the entities\nbased on the spatial position of the annotation.\n\nData requirements\n-----------------\n\n- You must supply at least 50, and no more than 100,000, training documents.\n- You must supply at least 1, and no more than 100, unique labels to annotate entities that you want to extract.\n- You can use a label to annotate between 1 and 10 words.\n- Label names can be between 2 and 30 characters.\n- You can include annotations in your JSON Lines files, or you can add annotations later by using the Google Cloud console after uploading documents.\n- You can include documents inline or reference TXT files that are in Cloud Storage buckets.\n\nBest practices for text data used to train AutoML models\n--------------------------------------------------------\n\nThe following recommendations apply to datasets used to train\nAutoML models.\n\n- Use each label at least 200 times in your training dataset.\n- Annotate every occurrence of entities that you want your model to identify.\n\nInput files\n-----------\n\nInput file types for entity extraction must be JSON Lines. The format, field\nnames, and value types for JSON Lines files are determined by a schema file,\nwhich\nare publicly accessible YAML files.\n\nYou can download the schema file for entity extraction from the following\nCloud Storage location: \n\n[gs://google-cloud-aiplatform/schema/dataset/ioformat/text_extraction_io_format_1.0.0.yaml](https://storage.cloud.google.com/google-cloud-aiplatform/schema/dataset/ioformat/text_extraction_io_format_1.0.0.yaml).\n\nThe following example shows how you might use the schema to create your\nown JSON Lines file. The example includes line breaks for readability. In your\nJSON files, include line breaks only after each document. The\n`dataItemResourceLabels` field specifies, for example, [ml_use](/vertex-ai/docs/general/ml-use) and is\noptional. \n\n```\n{\n \"textSegmentAnnotations\": [\n {\n \"startOffset\":number,\n \"endOffset\":number,\n \"displayName\": \"label\"\n },\n ...\n ],\n \"textContent\": \"inline_text\",\n \"dataItemResourceLabels\": {\n \"aiplatform.googleapis.com/ml_use\": \"training|test|validation\"\n }\n}\n{\n \"textSegmentAnnotations\": [\n {\n \"startOffset\":number,\n \"endOffset\":number,\n \"displayName\": \"label\"\n },\n ...\n ],\n \"textGcsUri\": \"gcs_uri_to_file\",\n \"dataItemResourceLabels\": {\n \"aiplatform.googleapis.com/ml_use\": \"training|test|validation\"\n }\n}\n```\n\nYou can also annotate documents by using the Google Cloud console. Create a\nJSON Lines file with content only (without the `textSegmentAnnotations` field);\ndocuments are uploaded to Vertex AI without any annotations."]]