

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

# Erkennen toxischer Sprache
<a name="toxicity-using"></a>

## Verwenden der Erkennung toxischer Sprache in einer Batch-Transkription
<a name="toxicity-using-batch"></a>

Beispiele für die Verwendung der Erkennung toxischer Sprache während einer Batch-Transkription finden Sie im Folgenden:

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

1. Melden Sie sich an der [AWS-Managementkonsole](https://console.aws.amazon.com/transcribe/) an.

1. Wählen Sie im Navigationsbereich **Transkriptionsaufträge** und dann **Auftrag erstellen** (oben rechts). Dies öffnet die Seite **Auftragsdetails angeben**.  
![Amazon Transcribe Konsolen-Screenshot: Die Seite „Jobdetails angeben“.](http://docs.aws.amazon.com/de_de/transcribe/latest/dg/images/toxicity-batch-details-1.png)

1.  Auf der Seite **Auftragsdetails angeben** können Sie auch die PII-Schwärzung aktivieren, wenn Sie dies wünschen. Beachten Sie, dass die anderen aufgeführten Optionen bei der Toxizitätserkennung nicht unterstützt werden. Klicken Sie auf **Weiter**. Hier gelangen Sie zur Seite **Auftrag konfigurieren – optional** . Wählen Sie im Bereich **Audioeinstellungen** die Option **Toxizitätserkennung**.   
![Amazon Transcribe Konsolen-Screenshot: Die Seite „Job konfigurieren“.](http://docs.aws.amazon.com/de_de/transcribe/latest/dg/images/toxicity-batch-details-2.png)

1. Wählen Sie **Auftrag erstellen**, um Ihren Transkriptionsauftrag auszuführen.

1. Sobald Ihr Transkriptionsauftrag abgeschlossen ist, können Sie Ihr Transkript über das Dropdown-Menü **Download** auf der Detailseite des Transkriptionsauftrags herunterladen.

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

In diesem Beispiel werden der [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html)Befehl und `ToxicityDetection` der Parameter verwendet. Weitere Informationen erhalten Sie unter [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) und [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
```

Hier ist ein weiteres Beispiel, in dem der [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html)Befehl verwendet wird, und ein Anforderungstext, der die Erkennung von Toxizität beinhaltet.

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

Die Datei *my-first-toxicity-job.json* enthält den folgenden Anfragetext.

```
{
  "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 für Python (Boto3)
<a name="toxicity-using-python-batch"></a>

 In diesem Beispiel wird die Methode AWS SDK für Python (Boto3) to enable `ToxicityDetection` für die Methode [start\_transcription\_job](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transcribe.html#TranscribeService.Client.start_transcription_job) verwendet. Weitere Informationen erhalten Sie unter [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html) und [https://docs.aws.amazon.com/transcribe/latest/APIReference/Welcome.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/Welcome.html). 

Weitere Beispiele für die Verwendung der AWS SDKs, einschließlich funktionsspezifischer, szenarienspezifischer und dienstübergreifender Beispiele, finden Sie im Kapitel. [Codebeispiele für Amazon Transcribe mit AWS SDKs](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)
```

## Beispielausgabe
<a name="toxicity-using-output"></a>

 Negative Sprache wird in Ihrer Transkriptionsausgabe mit Tags versehen und kategorisiert. Jede Instance der negativen Sprache wird kategorisiert und mit einem Konfidenzwert (einem Wert zwischen 0 und 1) versehen. Ein größerer Konfidenzwert zeigt an, dass es sich bei dem Inhalt mit größerer Wahrscheinlichkeit um negative Sprache innerhalb der angegebenen Kategorie handelt. 

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

 Nachfolgend finden Sie eine Beispielausgabe im JSON-Format, die kategorisierte negative Sprache mit den zugehörigen Konfidenzwerten anzeigt. 

```
{
    "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"
}
```