이 페이지에서는 감정 분석 모델을 학습시키기 위해 Vertex AI 데이터 세트에서 사용할 텍스트 데이터를 준비하는 방법을 설명합니다.
감정 분석 학습 데이터는 콘텐츠의 감정을 나타내는 감정 값과 연관된 문서로 구성됩니다. 예를 들어 항공 여행과 같은 특정 도메인에 대한 트윗을 사용할 수 있습니다. 각 트윗은 해당 트윗이 긍정적, 부정적, 중립적인지를 나타내는 감정 값과 연관됩니다.
데이터 요구사항
총 학습 문서를 최소 10개에서 최대 100,000개까지 제공해야 합니다.
감정 값은 0~10 사이의 정수여야 합니다. 최대 감정 값은 사용자 선택에 따라 달라집니다. 예를 들어 감정이 부정적, 긍정적, 중립적인지를 식별하려는 경우 감정 점수 0(부정적), 1(중립적), 2(긍정적)를 사용하여 학습 데이터에 라벨을 지정할 수 있습니다. 이 데이터 세트에서 최대 감정 점수는 2입니다. 5개 수준의 감정과 같이 보다 세부적으로 감정을 포착하려면 0(가장 부정적)부터 4(가장 긍정적)까지 문서에 라벨을 지정할 수 있습니다.
각 감정 값을 최소 10개 이상의 문서에 적용해야 합니다.
감정 점수 값은 0부터 시작하는 연속된 정수여야 합니다. 점수 간 격차가 있거나 0부터 시작하지 않으면 0부터 시작하는 연속된 정수가 되도록 점수를 다시 매핑합니다.
문서를 인라인으로 포함하거나 Cloud Storage 버킷에 있는 TXT 파일을 참조할 수 있습니다.
AutoML 모델 학습에 사용되는 텍스트 데이터를 위한 권장사항
다음 권장사항은 AutoML 모델 학습에 사용되는 데이터 세트에 적용됩니다.
감정 값당 최소 100개 이상의 문서를 제공합니다.
각 감정 점수에 대해 문서 수가 균형을 이루도록 합니다. 특정 감정 점수의 예시가 많으면 모델이 편향될 수 있습니다.
[[["이해하기 쉬움","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 sentiment analysis\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 sentiment analysis model.\n\nSentiment analysis training data consists of documents that are associated\nwith a sentiment value that indicates the sentiment of the content. For\nexample, you might have tweets about a particular domain such as air\ntravel. Each tweet is associated with sentiment value that indicates if the\ntweet is positive, negative, or neutral.\n\nData requirements\n-----------------\n\n- You must supply at least 10, but no more than 100,000, total training documents.\n- A sentiment value must be an integer from 0 to 10. The maximum sentiment value is your choice. For example, if you want to identify whether the sentiment is negative, positive, or neutral, you can label the training data with sentiment scores of 0 (negative), 1 (neutral), and 2 (positive). The maximum sentiment score for this dataset is 2. If you want to capture more granularity, such as five levels of sentiment, you can label documents from 0 (most negative) to 4 (most positive).\n- You must apply each sentiment value to at least 10 documents.\n- Sentiment score values must be consecutive integers starting from zero. If you have gaps in scores or don't start from zero, remap your scores to be consecutive integers starting from zero.\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- Provide at least 100 documents per sentiment value.\n- Use a balanced number of documents for each sentiment score. Having more examples for particular sentiment scores can introduce bias into the model.\n\nInput files\n-----------\n\nInput file types for sentiment analysis can be JSON Lines or CSV. \n\n### JSON Lines\n\nThe format, field names, value types for JSON Lines files are determined\nby a schema file, which are publicly accessible YAML files.\n\nYou can download the schema file for sentiment analysis from the\nfollowing Cloud Storage location: \n\n[gs://google-cloud-aiplatform/schema/dataset/ioformat/text_sentiment_io_format_1.0.0.yaml](https://storage.cloud.google.com/google-cloud-aiplatform/schema/dataset/ioformat/text_sentiment_io_format_1.0.0.yaml)\n\n**JSON Lines example**\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.\nIn your JSON Lines 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 \"sentimentAnnotation\": {\n \"sentiment\": number,\n \"sentimentMax\": number\n },\n \"textContent\": \"inline_text\",\n \"dataItemResourceLabels\": {\n \"aiplatform.googleapis.com/ml_use\": \"training|test|validation\"\n }\n}\n{\n \"sentimentAnnotation\": {\n \"sentiment\": number,\n \"sentimentMax\": number\n },\n \"textGcsUri\": \"gcs_uri_to_file\",\n \"dataItemResourceLabels\": {\n \"aiplatform.googleapis.com/ml_use\": \"training|test|validation\"\n }\n}\n```\n\n### CSV\n\nEach line in a CSV file refers to a single document. The following\nexample shows the general format of a valid CSV file. The [ml_use](/vertex-ai/docs/general/ml-use) column\nis optional. \n\n```\n [ml_use],gcs_file_uri|\"inline_text\",sentiment,sentimentMax\n \n```\n\nThe following snippet is an example of an input CSV file. \n\n```\n test,gs://path_to_file,sentiment_value,sentiment_max_value\n test,\"inline_text\",sentiment_value,sentiment_max_value\n training,gs://path_to_file,sentiment_value,sentiment_max_value\n validation,gs://path_to_file,sentiment_value,sentiment_max_value\n \n```"]]