

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

# 유해 언어 감지
<a name="toxicity"></a>

 유해 언어 감지는 P2P 대화가 필요한 소셜 미디어 플랫폼(예: 온라인 게임 플랫폼, 소셜 채팅 플랫폼)을 조정하는 데 도움이 되도록 고안되었습니다. 유해 언어의 사용은 개인, 동료 집단 및 커뮤니티에 심각한 해를 끼칠 수 있습니다. 유해한 언어에 플래그를 지정하면 조직에서 교양 있게 대화하고 사용자가 자유롭게 만들고 공유하고 참여할 수 있는 안전하고 포용적인 온라인 환경을 유지할 수 있습니다.

 Amazon Transcribe 유해성 감지는 오디오 및 텍스트 기반 신호를 모두 활용하여 성희롱, 혐오 표현, 위협, 학대, 욕설, 모욕, 노골적인 표현 등 7가지 범주에 걸쳐 음성 기반 유해 콘텐츠를 식별하고 분류합니다. Amazon Transcribe 유해성 감지는 텍스트 외에도 어조 및 음높이와 같은 음성 신호를 사용하여 말의 유해한 의도를 찾아냅니다. 이는 의도를 고려하지 않고 특정 용어에만 집중하도록 설계된 표준 콘텐츠 조정 시스템을 개선한 것입니다.

 Amazon Transcribe는 유해 언어에 플래그를 지정하고 분류하여 수동으로 처리해야 하는 데이터의 양을 최소화합니다. 이를 통해 콘텐츠 중재자는 플랫폼에서 담화를 빠르고 효율적으로 관리할 수 있습니다.

유해 언어 범주에는 다음이 포함됩니다.
+ **욕설**: 무례하거나 저속하거나 불쾌감을 주는 단어, 문구 또는 두문자어가 포함된 말.
+ **혐오 표현**: 정체성(예: 인종, 민족, 성별, 종교, 성적 취향, 능력, 출신 국가)을 근거로 개인이나 집단을 비판, 모욕, 비인간화하는 말.
+ **성적 표현**: 신체 부위, 신체적 특징 또는 성별을 직간접적으로 언급하여 성적 관심, 활동 또는 흥분을 나타내는 말.
+ **모욕**: 비하하거나, 굴욕하거나, 조롱하거나, 모욕하거나, 얕보는 표현이 포함된 말. 이러한 유형의 표현은 괴롭힘(bullying)으로도 분류됩니다.
+ **폭력 또는 위협**: 개인이나 집단에 대해 고통, 부상 또는 적대감을 주려는 위협이 포함된 말.
+ **노골적인 표현**: 시각적으로 묘사적이고 불쾌할 정도로 생생한 이미지를 사용하는 말. 이러한 유형의 표현은 상대방의 불편함을 증폭시키기 위해 일부러 장황하게 말하는 경우가 많습니다.
+ **괴롭힘(harassment) 또는 학대**: 상대방을 비하하고 객관화하는 표현을 포함하여 상대방의 심리적 안녕에 영향을 미치려는 의도를 가진 말. 이러한 유형의 표현은 괴롭힘(harassment)으로도 분류됩니다.

 유해성 감지는 음성 세그먼트(자연스러운 끊어읽기 사이의 음성)를 분석하고 이러한 세그먼트에 신뢰도 점수를 할당합니다. 신뢰도 점수는 0에서 1 사이의 값입니다. 신뢰도 점수가 높을수록 해당 콘텐츠가 관련 범주에서 유해 언어일 가능성이 커집니다. 이러한 신뢰도 점수를 사용하여 사용 사례에 적합한 유해성 감지 임계값을 설정할 수 있습니다.

**참고**  
 유해성 감지는 미국 영어`(en-US)`로 된 배치 트랜스크립션에서만 사용할 수 있습니다.

 JSON 형식의 [예시 출력](toxicity-using.md#toxicity-using-output.title)을 볼 수 있습니다.

# 유해 언어 감지 사용
<a name="toxicity-using"></a>

## 배치 트랜스크립션에 유해 언어 감지 기능 사용
<a name="toxicity-using-batch"></a>

배치 트랜스크립션에서 유해 언어 감지를 사용하려면 다음 예를 참조하십시오.

### AWS Management Console
<a name="toxicity-using-console-batch"></a>

1. 에 로그인합니다..[AWS Management Console](https://console.aws.amazon.com/transcribe/)

1. 탐색 창에서 **트랜스크립션 작업**을 선택한 다음 **작업 생성**(오른쪽 상단)을 선택합니다. 그러면 **작업 세부 정보 지정** 페이지가 열립니다.  
![\[Amazon Transcribe 콘솔 스크린샷: '작업 세부 정보 지정' 페이지.\]](http://docs.aws.amazon.com/ko_kr/transcribe/latest/dg/images/toxicity-batch-details-1.png)

1.  **작업 세부 정보 지정** 페이지에서 원하는 경우 PII 삭제를 활성화할 수도 있습니다. 나열된 다른 옵션은 유해성 감지에서 지원되지 않습니다. **다음**을 선택합니다. 그러면 **작업 구성 - 선택 사항** 페이지로 이동합니다. **오디오 설정** 패널에서 **유해성 감지**를 선택합니다.  
![\[Amazon Transcribe 콘솔 스크린샷: '작업 구성' 페이지.\]](http://docs.aws.amazon.com/ko_kr/transcribe/latest/dg/images/toxicity-batch-details-2.png)

1. **작업 생성**을 선택하여 트랜스크립션 작업을 실행합니다.

1. 트랜스크립션 작업이 완료되면 트랜스크립션 작업 세부 정보 페이지의 **다운로드** 드롭다운 메뉴에서 트랜스크립션을 다운로드할 수 있습니다.

### AWS CLI
<a name="toxicity-using-cli-batch"></a>

이 예시에서는 [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html) 명령 및 `ToxicityDetection` 파라미터를 사용합니다. 자세한 내용은 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) 및 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_ToxicityDetection.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_ToxicityDetection.html)을(를) 참조하세요.

```
aws transcribe start-transcription-job \
--region us-west-2 \
--transcription-job-name my-first-transcription-job \
--media MediaFileUri=s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac \
--output-bucket-name amzn-s3-demo-bucket \
--output-key my-output-files/ \
--language-code en-US \
--toxicity-detection ToxicityCategories=ALL
```

다음은 [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html) 명령을 사용하는 또 다른 예 및 유해성 감지를 포함하는 요청 본문입니다.

```
aws transcribe start-transcription-job \
--region us-west-2 \
--cli-input-json file://filepath/my-first-toxicity-job.json
```

*my-first-toxicity-job.json* 파일에는 다음과 같은 요청 본문이 포함되어 있습니다.

```
{
  "TranscriptionJobName": "my-first-transcription-job",
  "Media": {
        "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac"
  },
  "OutputBucketName": "amzn-s3-demo-bucket",
  "OutputKey": "my-output-files/", 
  "LanguageCode": "en-US",
  "ToxicityDetection": [ 
      { 
         "ToxicityCategories": [ "ALL" ]
      }
   ]
}
```

### AWS SDK for Python (Boto3)
<a name="toxicity-using-python-batch"></a>

 이 예시에서는 AWS SDK for Python (Boto3)를 사용하여 [start\$1transcription\$1job](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transcribe.html#TranscribeService.Client.start_transcription_job) 메서드의 `ToxicityDetection`를 활성화합니다. 자세한 내용은 [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) 및 [https://docs.aws.amazon.com/transcribe/latest/APIReference/Welcome.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/Welcome.html)을(를) 참조하세요.

기능별, 시나리오 및 교차 서비스 예를 포함하여 AWS SDK를 사용하는 추가 예시는 [AWS SDKs를 사용한 Amazon Transcribe의 코드 예제](service_code_examples.md) 장을 참조하세요.

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
job_name = "my-first-transcription-job"
job_uri = "s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac"
transcribe.start_transcription_job(
    TranscriptionJobName = job_name,
    Media = {
        'MediaFileUri': job_uri
    },
    OutputBucketName = 'amzn-s3-demo-bucket',
    OutputKey = 'my-output-files/', 
    LanguageCode = 'en-US', 
    ToxicityDetection = [ 
        { 
            'ToxicityCategories': ['ALL']
        }
    ]
)

while True:
    status = transcribe.get_transcription_job(TranscriptionJobName = job_name)
    if status['TranscriptionJob']['TranscriptionJobStatus'] in ['COMPLETED', 'FAILED']:
        break
    print("Not ready yet...")
    time.sleep(5)
print(status)
```

## 출력 예시
<a name="toxicity-using-output"></a>

 트랜스크립션 출력에서 유해 언어를 태깅하고 분류합니다. 유해 언어의 각 사례를 분류하고 신뢰도 점수(0에서 1 사이의 값)를 할당합니다. 신뢰도 값이 높을수록 콘텐츠가 지정된 범주 내에서 유해 언어일 가능성이 커집니다.

### 출력 예(JSON)
<a name="toxicity-using-output-json"></a>

 다음은 분류된 유해 언어와 관련 신뢰도 점수를 보여주는 JSON 형식의 출력 예시입니다.

```
{
    "jobName": "my-toxicity-job",
    "accountId": "111122223333",
    "results": {
        "transcripts": [...],
        "items":[...],
        "toxicity_detection": [
            {
                "text": "What the * are you doing man? That's why I didn't want to play with your * .  man it was a no, no I'm not calming down * man. I well I spent I spent too much * money on this game.",
                "toxicity": 0.7638,
                "categories": {
                    "profanity": 0.9913,
                    "hate_speech": 0.0382,
                    "sexual": 0.0016,
                    "insult": 0.6572,
                    "violence_or_threat": 0.0024,
                    "graphic": 0.0013,
                    "harassment_or_abuse": 0.0249
                },
                "start_time": 8.92,
                "end_time": 21.45
            },
            Items removed for brevity
            {
                "text": "What? Who? What the * did you just say to me? What's your address? What is your * address? I will pull up right now on your * * man. Take your * back to , tired of this **.",
                "toxicity": 0.9816,
                "categories": {
                    "profanity": 0.9865,
                    "hate_speech": 0.9123,
                    "sexual": 0.0037,
                    "insult": 0.5447,
                    "violence_or_threat": 0.5078,
                    "graphic": 0.0037,
                    "harassment_or_abuse": 0.0613
                },
                "start_time": 43.459,
                "end_time": 54.639
            },
        ]
    },
    ...
    "status": "COMPLETED"
}
```