

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 모델 평가 작업의 결과 이해
<a name="clarify-foundation-model-evaluate-results"></a>

다음 섹션을 사용하여 모델 평가 작업의 결과를 해석하는 방법을 알아봅니다. 자동 모델 평가 작업과 인간 기반 모델 평가 작업 모두에 대해 Amazon S3에 저장된 출력 JSON 데이터는 다릅니다. Studio를 사용하여 작업 결과가 Amazon S3에 저장되는 위치를 찾을 수 있습니다. 이렇게 하려면 Studio에서 **모델 평가** 홈 페이지를 열고 테이블에서 작업을 선택합니다.

## Studio에서 모델 평가 결과 보기
<a name="model-evaluation-console-results"></a>

모델 평가 작업이 완료되면 다음 단계를 사용하여 제공한 데이터세트에 대한 모델 성능을 확인할 수 있습니다.

1. Studio 탐색 창에서 **작업**을 선택한 다음 **모델 평가**를 선택합니다.

1. **모델 평가** 페이지에서 성공적으로 제출된 작업이 목록에 나타납니다. 목록에는 작업 이름, 상태, 모델 이름, 평가 유형 및 만든 날짜가 포함됩니다.

1. 모델 평가가 성공적으로 완료되면 작업 이름을 클릭하여 평가 결과 요약을 볼 수 있습니다.

1. 인간 분석 보고서를 보려면 검사하려는 작업의 이름을 선택합니다.

모델 평가 결과 해석에 대한 자세한 내용은 결과를 해석하려는 모델 평가 작업 유형에 해당하는 주제를 참조하세요.
+ [인간 평가 작업의 결과 이해](clarify-foundation-model-evaluate-results-human.md)
+ [자동 평가 작업의 결과 이해](clarify-foundation-model-evaluate-auto-ui-results.md)

# 인간 평가 작업의 결과 이해
<a name="clarify-foundation-model-evaluate-results-human"></a>

인간 작업자를 사용하는 모델 평가 작업을 만들 때 하나 이상의 *지표 유형*을 선택했습니다. 작업 팀 구성원이 작업자 포털에서 응답을 평가하면 응답이 `humanAnswers` json 객체에 저장됩니다. 이러한 응답이 저장되는 방법은 작업이 만들어질 때 선택한 지표 유형에 따라 달라집니다.

다음 섹션에서는 이러한 차이점을 설명하고 예시를 제공합니다.

## JSON 출력 참조
<a name="clarify-foundation-model-evaluate-results-human-ref"></a>

모델 평가 작업이 완료되면 결과가 Amazon S3에 JSON 파일로 저장됩니다. JSON 객체에는 세 개의 상위 수준 노드인 `humanEvaluationResult`, `inputRecord`, `modelResponses`가 포함되어 있습니다. `humanEvaluationResult` 키는 모델 평가 작업에 할당된 작업 팀의 응답을 포함하는 상위 수준 노드입니다. `inputRecord` 키는 모델 평가 작업이 만들어질 때 모델에 제공된 프롬프트가 포함된 상위 수준 노드입니다. `modelResponses` 키는 모델의 프롬프트에 대한 응답을 포함하는 상위 수준 노드입니다.

다음 표에는 모델 평가 작업의 JSON 출력에 있는 키 값 쌍이 요약되어 있습니다.

이어지는 섹션에서는 각 키 값 쌍에 대한 보다 세분화된 세부 정보를 제공합니다.


****  

| 파라미터 | 예제 | 설명 | 
| --- | --- | --- | 
|  `flowDefinitionArn`  |  arn:aws:sagemaker:us-west-2:111122223333:flow-definition/flow-definition-name  |  인적 루프를 만드는 데 사용된 인간 검토 워크플로(흐름 정의)의 ARN입니다.  | 
| humanAnswers |  선택한 평가 지표와 관련된 JSON 객체 목록입니다. 자세한 내용은 [`humanAnswers`에서 찾은 키 값 쌍](#clarify-foundation-model-evaluate-humanAnswers) 섹션을 참조하세요.  |  작업자 응답이 포함된 JSON 객체의 목록입니다.  | 
|  `humanLoopName`  | system-generated-hash | 시스템에서 40자의 16진수 문자열을 생성했습니다. | 
| inputRecord |  <pre>"inputRecord": {<br />    "prompt": {<br />        "text": "Who invented the airplane?"<br />    },<br />    "category": "Airplanes",<br />    "referenceResponse": {<br />        "text": "Orville and Wilbur Wright"<br />    },<br />    "responses":<br /><br />        [{<br />            "modelIdentifier": "meta-textgeneration-llama-codellama-7b",<br />            "text": "The Wright brothers, Orville and Wilbur Wright are widely credited with inventing and manufacturing the world's first successful airplane."<br />        }]<br />}</pre>  | 입력 데이터세트의 입력 프롬프트가 포함된 JSON 객체입니다. | 
| modelResponses |  <pre>"modelResponses": [{<br />    "modelIdentifier": "arn:aws:bedrock:us-west-2::foundation-model/model-id",<br />    "text": "the-models-response-to-the-prompt"<br />}]</pre>  | 모델의 개별 응답입니다. | 
| inputContent | <pre>{<br />    "additionalDataS3Uri":"s3://user-specified-S3-URI-path/datasets/dataset-name/records/record-number/human-loop-additional-data.json",<br />    "evaluationMetrics":[<br />        {<br />		  "description":"brief-name",<br />		  "metricName":"metric-name",<br />		  "metricType":"IndividualLikertScale"<br />	  }<br />    ],<br />    "instructions":"example instructions"<br />}</pre> |  Amazon S3 버킷에서 인적 루프를 시작하는 데 필요한 인적 루프 입력 콘텐츠입니다.  | 
| modelResponseIdMap | <pre>{<br />   "0": "sm-margaret-meta-textgeneration-llama-2-7b-1711485008-0612",<br />   "1": "jumpstart-dft-hf-llm-mistral-7b-ins-20240327-043352"<br />}</pre> |  `answerContent`에서 각 모델을 나타내는 방법을 설명합니다.  | 

### `humanEvaluationResult`에서 찾은 키 값 쌍
<a name="clarify-foundation-model-evaluate-humanEvaluationResult"></a>

 다음 키 값 쌍은 모델 평가 작업의 출력에서 `humanEvaluationResult`에서 찾을 수 있습니다.

`humanAnswers`와 연결된 키 값 쌍은 [`humanAnswers`에서 찾은 키 값 쌍](#clarify-foundation-model-evaluate-humanAnswers) 섹션을 참조하세요.

**`flowDefinitionArn`**
+ 모델 평가 작업을 완료하는 데 사용되는 흐름 정의의 ARN입니다.
+ *예:*`arn:aws:sagemaker:us-west-2:111122223333:flow-definition/flow-definition-name`

**`humanLoopName`**
+ 시스템에서 40자의 16진수 문자열을 생성했습니다.

**`inputContent`**
+ 이 키 값은 *지표 유형*과 작업자 포털에서 작업자에게 제공한 지침을 설명합니다.
  + `additionalDataS3Uri`: 작업자에 대한 지침이 저장되는 Amazon S3의 위치입니다.
  + `instructions`: 작업자 포털에서 작업자에게 제공한 지침입니다.
  + `evaluationMetrics`: 지표의 이름과 해당 설명입니다. `metricType` 키 값은 모델의 응답을 평가하기 위해 작업자에게 제공되는 도구입니다.

**`modelResponseIdMap`**
+ 이 키 값 쌍은 선택한 모델의 전체 이름과 작업자의 선택이 `humanAnswers` 키 값 쌍의 모델에 매핑되는 방법을 식별합니다.

### `inputRecord`에서 찾은 키 값 쌍
<a name="clarify-foundation-model-evaluate-inputRecord"></a>

다음 항목은 `inputRecord` 키 값 쌍을 설명합니다.

**`prompt`**
+ 모델로 전송된 프롬프트의 텍스트입니다.

**`category`**
+ 프롬프트를 분류하는 선택적 범주입니다. 모델 평가 중에 작업자 포털에서 작업자가 볼 수 있습니다.
+ *예:*`"American cities"`

**`referenceResponse`**
+ 평가 중에 작업자가 참조할 실제 응답을 지정하는 데 사용되는 입력 JSON의 선택적 필드입니다.

**`responses`**
+ 다른 모델의 응답을 포함하는 입력 JSON의 선택적 필드입니다.

예시 JSON 입력 레코드입니다.

```
{
  "prompt": {
     "text": "Who invented the airplane?"
  },
  "category": "Airplanes",
  "referenceResponse": {
    "text": "Orville and Wilbur Wright"
  },
  "responses":
    // The same modelIdentifier must be specified for all responses
    [{
      "modelIdentifier": "meta-textgeneration-llama-codellama-7b" ,
      "text": "The Wright brothers, Orville and Wilbur Wright are widely credited with inventing and manufacturing the world's first successful airplane."
    }]
}
```

### `modelResponses`에서 찾은 키 값 쌍
<a name="clarify-foundation-model-evaluate-modelResponses"></a>

모델의 응답과 응답을 제공한 모델을 포함하는 키 값 쌍의 배열입니다.

**`text`**
+ 프롬프트에 대한 모델의 응답입니다.

**`modelIdentifier`**
+ 모델의 이름입니다.

### `humanAnswers`에서 찾은 키 값 쌍
<a name="clarify-foundation-model-evaluate-humanAnswers"></a>

모델의 응답과 작업자가 모델을 평가한 방법을 포함하는 키 값 쌍의 배열입니다.

**`acceptanceTime`**
+ 작업자가 작업자 포털에서 작업을 수락한 시간입니다.

**`submissionTime`**
+ 작업자가 응답을 제출한 시간입니다.

**`timeSpentInSeconds`**
+ 작업자가 작업을 완료하는 데 소요한 시간입니다.

**`workerId`**
+ 작업을 완료한 작업자의 ID입니다.

**`workerMetadata`**
+ 이 모델 평가 작업에 할당된 작업 팀에 대한 메타데이터입니다.

#### `answerContent` JSON 배열의 형식
<a name="clarify-foundation-model-evaluate-humanAnswers-answerconent"></a>

응답 구조는 모델 평가 작업이 만들어질 때 선택한 평가 지표에 따라 달라집니다. 각 작업자 응답 또는 답변은 새 JSON 객체에 기록됩니다.

**`answerContent`**
+ `evaluationResults`에는 작업자의 응답이 포함되어 있습니다.
  + **선택 버튼**을 선택하면 각 작업자의 결과가 `"evaluationResults": "comparisonChoice"`로 표시됩니다.

    `metricName`: 지표의 이름입니다.

    `result`: JSON 객체는 `0` 또는 `1`을 사용하여 작업자가 선택한 모델을 나타냅니다. 모델이 매핑되는 값을 확인하려면 `modelResponseIdMap`을 참조하세요.
  + **리커트 척도, 비교**를 선택하면 각 작업자의 결과가 `"evaluationResults": "comparisonLikertScale"`로 표시됩니다.

    `metricName`: 지표의 이름입니다.

    `leftModelResponseId`: 작업자 포털의 왼쪽에 표시된 `modelResponseIdMap`을 나타냅니다.

    `rightModelResponseId`: 작업자 포털의 왼쪽에 표시된 `modelResponseIdMap`을 나타냅니다.

    `result`: JSON 객체는 `0` 또는 `1`을 사용하여 작업자가 선택한 모델을 나타냅니다. 모델이 매핑되는 값을 확인하려면 `modelResponseIdMap`을 참조하세요.
  + **서수 순위**를 선택하면 각 작업자의 결과가 `"evaluationResults": "comparisonRank"`로 표시됩니다.

    `metricName`: 지표의 이름입니다.

    `result`: JSON 객체 배열입니다. 각 모델(`modelResponseIdMap`)에 대해 작업자는 `rank`를 제공합니다.

    ```
    "result": [{
    	"modelResponseId": "0",
    	"rank": 1
    }, {
    	"modelResponseId": "1",
    	"rank": 1
    }]
    ```
  + **리커트 척도, 단일 모델의 응답 평가**를 선택하면 작업자의 결과가 `"evaluationResults": "individualLikertScale"`에 저장됩니다. 이는 작업이 만들어질 때 지정된 `metricName`에 대한 점수를 포함하는 JSON 배열입니다.

    `metricName`: 지표의 이름입니다.

    `modelResponseId`: 점수가 매겨진 모델입니다. 모델이 매핑되는 값을 확인하려면 `modelResponseIdMap`을 참조하세요.

    `result`: 작업자가 선택한 리커트 척도 값을 나타내는 키 값 쌍입니다.
  + **추천/반대**를 선택하면 작업자의 결과가 JSON 배열 `"evaluationResults": "thumbsUpDown"`으로 저장됩니다.

    `metricName`: 지표의 이름입니다.

    `result`: `metricName`과 관련된 `true` 또는 `false`입니다. 작업자가 추천을 선택하면 `"result" : true`입니다.

## 모델 평가 작업 출력의 예시 출력
<a name="clarify-foundation-model-evaluate-results-human-example"></a>

다음 JSON 객체는 Amazon S3에 저장된 모델 평가 작업 출력의 예입니다. 각 키 값 쌍에 대한 자세한 내용은 [JSON 출력 참조](#clarify-foundation-model-evaluate-results-human-ref) 섹션을 참조하세요.

명확성을 위해 이 작업에는 두 작업자의 응답만 포함되어 있습니다. 일부 키 값 쌍은 가독성을 위해 잘렸을 수 있습니다.

```
{
	"humanEvaluationResult": {
		"flowDefinitionArn": "arn:aws:sagemaker:us-west-2:111122223333:flow-definition/flow-definition-name",
        "humanAnswers": [
            {
                "acceptanceTime": "2024-06-07T22:31:57.066Z",
                "answerContent": {
                    "evaluationResults": {
                        "comparisonChoice": [
                            {
                                "metricName": "Fluency",
                                "result": {
                                    "modelResponseId": "0"
                                }
                            }
                        ],
                        "comparisonLikertScale": [
                            {
                                "leftModelResponseId": "0",
                                "metricName": "Coherence",
                                "result": 1,
                                "rightModelResponseId": "1"
                            }
                        ],
                        "comparisonRank": [
                            {
                                "metricName": "Toxicity",
                                "result": [
                                    {
                                        "modelResponseId": "0",
                                        "rank": 1
                                    },
                                    {
                                        "modelResponseId": "1",
                                        "rank": 1
                                    }
                                ]
                            }
                        ],
                        "individualLikertScale": [
                            {
                                "metricName": "Correctness",
                                "modelResponseId": "0",
                                "result": 2
                            },
                            {
                                "metricName": "Correctness",
                                "modelResponseId": "1",
                                "result": 3
                            },
                            {
                                "metricName": "Completeness",
                                "modelResponseId": "0",
                                "result": 1
                            },
                            {
                                "metricName": "Completeness",
                                "modelResponseId": "1",
                                "result": 4
                            }
                        ],
                        "thumbsUpDown": [
                            {
                                "metricName": "Accuracy",
                                "modelResponseId": "0",
                                "result": true
                            },
                            {
                                "metricName": "Accuracy",
                                "modelResponseId": "1",
                                "result": true
                            }
                        ]
                    }
                },
                "submissionTime": "2024-06-07T22:32:19.640Z",
                "timeSpentInSeconds": 22.574,
                "workerId": "ead1ba56c1278175",
                "workerMetadata": {
                    "identityData": {
                        "identityProviderType": "Cognito",
                        "issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_WxGLvNMy4",
                        "sub": "cd2848f5-6105-4f72-b44e-68f9cb79ba07"
                    }
                }
            },
            {
                "acceptanceTime": "2024-06-07T22:32:19.721Z",
                "answerContent": {
                    "evaluationResults": {
                        "comparisonChoice": [
                            {
                                "metricName": "Fluency",
                                "result": {
                                    "modelResponseId": "1"
                                }
                            }
                        ],
                        "comparisonLikertScale": [
                            {
                                "leftModelResponseId": "0",
                                "metricName": "Coherence",
                                "result": 1,
                                "rightModelResponseId": "1"
                            }
                        ],
                        "comparisonRank": [
                            {
                                "metricName": "Toxicity",
                                "result": [
                                    {
                                        "modelResponseId": "0",
                                        "rank": 2
                                    },
                                    {
                                        "modelResponseId": "1",
                                        "rank": 1
                                    }
                                ]
                            }
                        ],
                        "individualLikertScale": [
                            {
                                "metricName": "Correctness",
                                "modelResponseId": "0",
                                "result": 3
                            },
                            {
                                "metricName": "Correctness",
                                "modelResponseId": "1",
                                "result": 4
                            },
                            {
                                "metricName": "Completeness",
                                "modelResponseId": "0",
                                "result": 1
                            },
                            {
                                "metricName": "Completeness",
                                "modelResponseId": "1",
                                "result": 5
                            }
                        ],
                        "thumbsUpDown": [
                            {
                                "metricName": "Accuracy",
                                "modelResponseId": "0",
                                "result": true
                            },
                            {
                                "metricName": "Accuracy",
                                "modelResponseId": "1",
                                "result": false
                            }
                        ]
                    }
                },
                "submissionTime": "2024-06-07T22:32:57.918Z",
                "timeSpentInSeconds": 38.197,
                "workerId": "bad258db224c3db6",
                "workerMetadata": {
                    "identityData": {
                        "identityProviderType": "Cognito",
                        "issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_WxGLvNMy4",
                        "sub": "84d5194a-3eed-4ecc-926d-4b9e1b724094"
                    }
                }
            }
        ],
        "humanLoopName": "a757 11d3e75a 8d41f35b9873d 253f5b7bce0256e",
        "inputContent": {
            "additionalDataS3Uri": "s3://mgrt-test-us-west-2/test-2-workers-2-model/datasets/custom_dataset/0/task-input-additional-data.json",
            "instructions": "worker instructions provided by the model evaluation job administrator",
            "evaluationMetrics": [
                {
                    "metricName": "Fluency",
                    "metricType": "ComparisonChoice",
                    "description": "Measures the linguistic quality of a generated text."
                },
                {
                    "metricName": "Coherence",
                    "metricType": "ComparisonLikertScale",
                    "description": "Measures the organization and structure of a generated text."
                },
                {
                    "metricName": "Toxicity",
                    "metricType": "ComparisonRank",
                    "description": "Measures the harmfulness of a generated text."
                },
                {
                    "metricName": "Accuracy",
                    "metricType": "ThumbsUpDown",
                    "description": "Indicates the accuracy of a generated text."
                },
                {
                    "metricName": "Correctness",
                    "metricType": "IndividualLikertScale",
                    "description": "Measures a generated answer's satisfaction in the context of the question."
                },
                {
                    "metricName": "Completeness",
                    "metricType": "IndividualLikertScale",
                    "description": "Measures a generated answer's inclusion of all relevant information."
                }
            ],
            "disableRandomization": "true"
        },
        "modelResponseIdMap": {
            "0": "sm-margaret-meta-textgeneration-llama-2-7b-1711485008-0612",
            "1": "jumpstart-dft-hf-llm-mistral-7b-ins-20240327-043352"
        }
    },
    "inputRecord": {
        "prompt": {
            "text": "What is high intensity interval training?"
        },
        "category": "Fitness",
        "referenceResponse": {
            "text": "High-Intensity Interval Training (HIIT)"
        }
    },
    "modelResponses": [
        {
            "text": "High Intensity Interval Training (HIIT) is a form of exercise that alternates between periods of high intensity work and low intensity recovery.HIIT is an excellent way to increase your fitness and improve your health, but it can be difficult to get started.In this article, we will",
            "modelIdentifier": "sm-margaret-meta-textgeneration-llama-2-7b-1711485008-0612"
        },
        {
            "text": "High intensity interval training is a form of exercise consisting of short bursts of maximum effort followed by periods of rest. The theory behind HIIT is that it can often be more effective at improving cardiovascular and metabolic health than longer, lower intensity workouts.The work intervals can range in length depending on the specific type of exercise, but are typically between 20 and 90 seconds. The recovery periods are generally longer, lasting between 1 and 5 minutes. This pattern is then repeated for multiple sets.\n\nSince the work intervals are high intensity, they require more effort from your body and therefore result in a greater calorie burn. The body also continues to burn calories at an increased rate after the workout due to an effect called excess post exercise oxygen consumption (EPOC), also know as the afterburn effect.\n\nHIIT is a versatile form of training that can be adapted to different fitness levels and can be performed using a variety of exercises including cycling, running, bodyweight movements, and even swimming. It can be done in as little as 20 minutes once or twice a week, making it an efficient option for busy individuals.\n\nWhat are the benefits of high intensity interval training",
            "modelIdentifier": "jumpstart-dft-hf-llm-mistral-7b-ins-20240327-043352"
        }
    ]
}
```

# 자동 평가 작업의 결과 이해
<a name="clarify-foundation-model-evaluate-auto-ui-results"></a>

자동 모델 평가 작업이 완료되면 결과가 Amazon S3에 저장됩니다. 아래 섹션에서는 생성된 파일과 이를 해석하는 방법을 설명합니다.

## `output.json` 파일 구조 해석
<a name="clarify-foundation-model-evaluate-auto-ui-results-json"></a>

`output.json` 파일에는 선택한 데이터세트 및 지표의 집계 점수가 포함됩니다.

다음은 출력의 예시입니다.

```
{
    "evaluations": [{
        "evaluation_name": "factual_knowledge",
        "dataset_name": "trex",
		## The structure of the prompt template changes based on the foundation model selected
		"prompt_template": "<s>[INST] <<SYS>>Answer the question at the end in as few words as possible. Do not repeat the question. Do not answer in complete sentences.<</SYS> Question: $feature [/INST]",
        "dataset_scores": [{
            "name": "factual_knowledge",
            "value": 0.2966666666666667
        }],
        "category_scores": [{
                "name": "Author",
                "scores": [{
                    "name": "factual_knowledge",
                    "value": 0.4117647058823529
                }]
            },
				....
            {
                "name": "Capitals",
                "scores": [{
                    "name": "factual_knowledge",
                    "value": 0.2857142857142857
                }]
            }
        ]
    }]
}
```

## 인스턴스별 결과 파일의 구조 해석
<a name="clarify-foundation-model-evaluate-auto-ui-results-jsonl"></a>

각 jsonlines 요청에 대한 인스턴스별 결과가 포함된 하나의 *evaluation\$1name* *\$1dataset\$1name* .jsonl 파일입니다. jsonlines 입력 데이터에 `300` 요청이 있는 경우 이 jsonlines 출력 파일에 `300` 응답이 포함됩니다. 출력 파일에는 모델에 대한 요청과 해당 평가의 점수가 포함됩니다. 인스턴스 전체 출력의 예시입니다.

## 보고서 해석
<a name="clarify-foundation-model-evaluate-auto-ui-results-report"></a>

**평가 보고서**에는 파운데이션 모델 평가 작업의 결과가 포함됩니다. 평가 보고서의 내용은 모델을 평가하는 데 사용한 작업의 종류에 따라 달라집니다. 각 보고서에는 다음 섹션이 포함되어 있습니다.

1. 평가 작업에서 성공한 각 평가의 **전체 점수**입니다. 하나의 데이터세트가 포함된 하나의 평가의 예시로, 분류 작업의 정확도 및 의미 체계 견고성에 대해 모델을 평가한 경우 정확도 및 정확도 의미 체계 견고성에 대한 평가 결과를 요약하는 표가 보고서 상단에 나타납니다. 다른 데이터세트를 사용한 다른 평가는 다르게 구조화될 수 있습니다.

1. 모델 이름, 유형, 사용된 평가 방법, 모델이 평가된 데이터세트를 포함한 평가 작업의 구성입니다.

1. 평가 알고리즘을 요약하고, 기본 제공 데이터세트에 대한 정보와 링크, 점수 계산 방법, 관련 점수와 함께 일부 샘플 데이터를 보여주는 테이블을 제공하는 **세부 평가 결과** 섹션입니다.

1. 완료되지 않은 평가 목록이 포함된 **실패한 평가** 섹션입니다. 실패한 평가가 없는 경우 보고서의 이 섹션은 생략됩니다.