OpenAI のモデレーションモデルを使うと、テキストや画像に含まれる有害なコンテンツを検出できます。モデレーションエンドポイント で入力を単独で分類することも、レスポンスの生成時にモデレーションスコアを併せて取得することもできます。判定結果を使って、アプリケーションのポリシーを適用してください。たとえば、コンテンツをフィルタリングしたり、リクエストをレビューに回したり、フラグが付いたコンテンツを送信したアカウントに対して措置を講じたりできます。
omni-moderation-latest モデルはテキストと画像の入力に対応しています。音声は分類できません。モデレーションエンドポイントは無料で利用できます。画像ファイルのサイズ上限は 20 MB です。
子どもの安全: 児童性的虐待コンテンツ(CSAM)に該当する、またはその疑いがあるコンテンツを Moderation API に送信しないでください。この API は CSAM の検出や取り扱いを想定して設計されておらず、子どもの安全を守るための専用の対策に代わるものではありません。CSAM の防止、検出、対応、通報の手順については、CSAM に関するガイダンス を参照してください。
ワークフロー
利用場面
生成コンテンツのモデレーション
Responses API または Chat Completions API でテキストを生成し、モデレーションの判定結果も利用したい場合
入力の単独分類
モデルのレスポンスを生成せずに、テキストや画像を分類したい場合
モデレーション結果の読み方
フラグ、カテゴリ、スコア、判定対象の入力タイプの意味を確認したい場合
対応カテゴリの一覧
各カテゴリの判定対象がテキスト、画像、またはその両方のどれに当たるかを確認したい場合
生成テキストとモデレーションスコアの両方が必要な場合は、生成リクエストのトップレベルに moderation オブジェクトを指定します。API は、モデルへの入力と生成された出力のそれぞれについてモデレーションスコアを返します。モデレーション用のリクエストを別途送信する必要はありません。
モデルは通常どおりテキストを生成します。ユーザーに出力を表示したり、後続の処理を実行したりする前に、モデレーション結果を確認してください。
レスポンスの作成時に moderation.model を設定します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
model: "gpt-6-astra",
input: [
{
role: "user",
content:
"A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative.",
},
],
moderation: { model: "omni-moderation-latest" },
});
const inputModeration = response.moderation.input;
const outputModeration = response.moderation.output;
if (inputModeration.type === "error") {
throw new Error(inputModeration.message);
}
if (outputModeration.type === "error") {
throw new Error(outputModeration.message);
}
console.log(inputModeration.flagged);
console.log(outputModeration.flagged); 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model = "gpt-6-astra" ,
input = [
{
"role" : "user" ,
"content" : (
"A user asks for instructions to make a harmful weapon. "
"Draft a brief refusal and offer a safer alternative."
),
}
],
moderation = { "model" : "omni-moderation-latest" },
)
input_moderation = response.moderation.input
output_moderation = response.moderation.output
if input_moderation.type == "error" :
raise RuntimeError (input_moderation.message)
if output_moderation.type == "error" :
raise RuntimeError (output_moderation.message)
print (input_moderation.flagged)
print (output_moderation.flagged) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 package main
import (
"context"
"errors"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{
Model: "gpt-6-astra",
Input: responses.ResponseNewParamsInputUnion{
OfString: openai.String("A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative."),
},
Moderation: responses.ResponseNewParamsModeration{
Model: "omni-moderation-latest",
},
})
if err != nil {
panic(err)
}
switch inputModeration := response.Moderation.Input.AsAny().(type) {
case responses.ResponseModerationInputModerationResult:
fmt.Println(inputModeration.Flagged)
case responses.ResponseModerationInputError:
panic(errors.New(inputModeration.Message))
default:
panic("unexpected input moderation result")
}
switch outputModeration := response.Moderation.Output.AsAny().(type) {
case responses.ResponseModerationOutputModerationResult:
fmt.Println(outputModeration.Flagged)
case responses.ResponseModerationOutputError:
panic(errors.New(outputModeration.Message))
default:
panic("unexpected output moderation result")
}
} 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.JsonValue;
import com.openai.models.responses.ResponseCreateParams;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
ResponseCreateParams params =
ResponseCreateParams.builder()
.model("gpt-6-astra")
.input(
"A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative.")
.putAdditionalBodyProperty(
"moderation", JsonValue.from(Map.of("model", "omni-moderation-latest")))
.build();
var response = client.responses().create(params);
var moderation =
response
.moderation()
.orElseThrow(
() -> new IllegalStateException("The response did not include moderation results"));
List<Boolean> flags = new ArrayList<>();
var input = moderation.input();
if (input.isError()) {
throw new IllegalStateException(input.asError().message());
}
if (!input.isModerationResult()) {
throw new IllegalStateException("Missing input moderation flag");
}
flags.add(input.asModerationResult().flagged());
var output = moderation.output();
if (output.isError()) {
throw new IllegalStateException(output.asError().message());
}
if (!output.isModerationResult()) {
throw new IllegalStateException("Missing output moderation flag");
}
flags.add(output.asModerationResult().flagged());
flags.forEach(System.out::println); 1
2
3
4
5
6
7
8
9
10
11 require "openai"
client = OpenAI::Client.new
response = client.responses.create(
model: "gpt-6-astra",
input: "A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative.",
moderation: { model: "omni-moderation-latest" }
)
puts(response.moderation) Responses API が返す入力の moderation_result オブジェクトは response.moderation.input に、出力の moderation_result オブジェクトは response.moderation.output に格納されます。
チャット補完の作成時に moderation.model を設定します。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 import OpenAI from "openai";
const client = new OpenAI();
const completion = await client.chat.completions.create({
model: "gpt-6-astra",
messages: [
{
role: "user",
content:
"A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative.",
},
],
moderation: { model: "omni-moderation-latest" },
});
const inputResult = completion.moderation.input;
const outputResult = completion.moderation.output;
if (inputResult.type === "error") throw new Error(inputResult.message);
if (outputResult.type === "error") throw new Error(outputResult.message);
const inputModeration = inputResult.results[0];
const outputModeration = outputResult.results[0];
console.log(inputModeration.flagged);
console.log(outputModeration.flagged); 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 from openai import OpenAI
client = OpenAI()
completion = client.chat.completions.create(
model = "gpt-6-astra" ,
messages = [
{
"role" : "user" ,
"content" : (
"A user asks for instructions to make a harmful weapon. "
"Draft a brief refusal and offer a safer alternative."
),
}
],
moderation = { "model" : "omni-moderation-latest" },
)
input_result = completion.moderation.input
output_result = completion.moderation.output
if input_result.type == "error" :
raise RuntimeError (input_result.message)
if output_result.type == "error" :
raise RuntimeError (output_result.message)
input_moderation = input_result.results[ 0 ]
output_moderation = output_result.results[ 0 ]
print (input_moderation.flagged)
print (output_moderation.flagged) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 package main
import (
"context"
"errors"
"fmt"
"github.com/openai/openai-go/v3"
)
func main() {
client := openai.NewClient()
completion, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: "gpt-6-astra",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative."),
},
Moderation: openai.ChatCompletionNewParamsModeration{
Model: "omni-moderation-latest",
},
})
if err != nil {
panic(err)
}
switch inputResult := completion.Moderation.Input.AsAny().(type) {
case openai.ChatCompletionModerationInputModerationResults:
if len(inputResult.Results) == 0 {
panic("missing input moderation result")
}
fmt.Println(inputResult.Results[0].Flagged)
case openai.ChatCompletionModerationInputError:
panic(errors.New(inputResult.Message))
default:
panic("unexpected input moderation result")
}
switch outputResult := completion.Moderation.Output.AsAny().(type) {
case openai.ChatCompletionModerationOutputModerationResults:
if len(outputResult.Results) == 0 {
panic("missing output moderation result")
}
fmt.Println(outputResult.Results[0].Flagged)
case openai.ChatCompletionModerationOutputError:
panic(errors.New(outputResult.Message))
default:
panic("unexpected output moderation result")
}
} 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.JsonValue;
import com.openai.models.chat.completions.ChatCompletionCreateParams;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
ChatCompletionCreateParams params =
ChatCompletionCreateParams.builder()
.model("gpt-6-astra")
.addUserMessage(
"A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative.")
.putAdditionalBodyProperty(
"moderation", JsonValue.from(Map.of("model", "omni-moderation-latest")))
.build();
var completion = client.chat().completions().create(params);
var moderation =
completion
.moderation()
.orElseThrow(
() ->
new IllegalStateException("The completion did not include moderation results"));
List<Boolean> flags = new ArrayList<>();
var input = moderation.input();
if (input.isError()) {
throw new IllegalStateException(input.asError().message());
}
if (!input.isModerationResults() || input.asModerationResults().results().isEmpty()) {
throw new IllegalStateException("Missing input moderation flag");
}
flags.add(input.asModerationResults().results().get(0).flagged());
var output = moderation.output();
if (output.isError()) {
throw new IllegalStateException(output.asError().message());
}
if (!output.isModerationResults() || output.asModerationResults().results().isEmpty()) {
throw new IllegalStateException("Missing output moderation flag");
}
flags.add(output.asModerationResults().results().get(0).flagged());
flags.forEach(System.out::println); 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 require "openai"
client = OpenAI::Client.new
completion = client.chat.completions.create(
model: "gpt-6-astra",
messages: [
{
role: :user,
content: "A user asks for instructions to make a harmful weapon. Draft a brief refusal and offer a safer alternative."
}
],
moderation: { model: "omni-moderation-latest" }
)
puts(completion.moderation) Chat Completions API では、モデレーション結果を格納するコンテナが completion.moderation.input と completion.moderation.output に返されます。生成される候補が 1 つの場合は、入力と出力それぞれの results[0] から先頭の結果を取得します。複数の候補をリクエストした場合、completion.moderation.output.results[i] は completion.choices[i] に対応します。
生成時に返されるモデレーション結果のカテゴリフィールドは、入力を単独で分類した場合と同じです。まず flagged で一次判定を行い、次に categories と category_scores を確認して、ログの記録、リクエストの振り分け、監査証跡の作成、担当者によるレビュー待ちキューへの追加に利用します。リクエストを拒否するなど、安全性に配慮したレスポンスでも、有害なコンテンツに言及していればフラグが付くことがあります。モデレーションスコアは、アプリケーションのポリシーに沿って判断するための指標として扱い、スコアだけで自動的にブロックするかどうかを決めないでください。
アプリケーションでモデレーションの失敗に対応する必要がある場合は、スコアを読み取る前にモデレーション結果の型を確認してください。モデレーション処理が完了しなかった場合、該当する入力または出力のモデレーションフィールドには、スコアの代わりにエラーが格納されることがあります。
ツールを呼び出すリクエストでは、会話の内容に含まれるツール呼び出しの引数とツールの出力がモデレーションの対象になります。ツール名、ツールの説明、ツールのスキーマ、レスポンス形式のスキーマは対象外です。
生成レスポンスをストリーミングする場合、モデレーションスコアは出力全体が生成された後に届きます。ストリーミング中に届く部分出力の差分には含まれません。
モデレーションエンドポイント を使うと、モデルのレスポンスを生成せずにテキストや画像の入力を分類できます。以下のタブでは、OpenAI ライブラリ と omni-moderation-latest モデル の使い方を示します。
テキスト入力のモデレーション 画像とテキストのモデレーション テキスト入力のモデレーション
1
2
3
4
5
6
7
8
9 import OpenAI from "openai";
const openai = new OpenAI();
const moderation = await openai.moderations.create({
model: "omni-moderation-latest",
input: "...text to classify goes here...",
});
console.log(moderation); 1
2
3
4
5
6
7
8
9
10 from openai import OpenAI
client = OpenAI()
response = client.moderations.create(
model = "omni-moderation-latest" ,
input = "...text to classify goes here..." ,
)
print (response) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
)
func main() {
client := openai.NewClient()
moderation, err := client.Moderations.New(context.Background(), openai.ModerationNewParams{
Model: openai.ModerationModelOmniModerationLatest,
Input: openai.ModerationNewParamsInputUnion{
OfString: openai.String("Text to classify goes here."),
},
})
if err != nil {
panic(err)
}
fmt.Println(moderation.Results[0].Flagged)
} 1
2
3
4
5
6
7
8
9
10
11
12
13
14 import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.moderations.ModerationCreateParams;
var moderation =
client
.moderations()
.create(
ModerationCreateParams.builder()
.model("omni-moderation-latest")
.input("Text to classify goes here.")
.build());
System.out.println(moderation.results().get(0).flagged()); 1
2
3
4
5
6
7
8
9
10
11
12
13
14 using OpenAI.Moderations;
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
string model = "omni-moderation-latest";
ModerationClient client = new(model, key);
ModerationResult result = await client.ClassifyTextAsync(
"Text to classify goes here."
);
Console.WriteLine($"Flagged: {result.Flagged}");
Console.WriteLine(
$"Violence: {result.Violence.Flagged}; score: {result.Violence.Score:F3}"
); 1
2
3
4
5
6
7
8
9
10 require "openai"
client = OpenAI::Client.new
moderation = client.moderations.create(
model: OpenAI::Models::ModerationModel::OMNI_MODERATION_LATEST,
input: "Text to classify goes here."
)
puts(moderation.results.fetch(0).flagged) 1
2
3
4
5
6
7
8 curl https://api.openai.com/v1/moderations \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "omni-moderation-latest",
"input": "...text to classify goes here..."
}' 画像とテキストのモデレーション
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import OpenAI from "openai";
const openai = new OpenAI();
const moderation = await openai.moderations.create({
model: "omni-moderation-latest",
input: [
{ type: "text", text: "...text to classify goes here..." },
{
type: "image_url",
image_url: {
url: "https://example.com/image.png",
// You can also use a Base64 encoded image URL.
// url: "data:image/jpeg;base64,abcdefg...",
},
},
],
});
console.log(moderation); 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 from openai import OpenAI
client = OpenAI()
response = client.moderations.create(
model = "omni-moderation-latest" ,
input = [
{ "type" : "text" , "text" : "...text to classify goes here..." },
{
"type" : "image_url" ,
"image_url" : {
"url" : "https://example.com/image.png" ,
# You can also use a Base64 encoded image URL.
# "url": "data:image/jpeg;base64,abcdefg..."
},
},
],
)
print (response) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
)
func main() {
client := openai.NewClient()
moderation, err := client.Moderations.New(context.Background(), openai.ModerationNewParams{
Model: openai.ModerationModelOmniModerationLatest,
Input: openai.ModerationNewParamsInputUnion{
OfModerationMultiModalArray: []openai.ModerationMultiModalInputUnionParam{
openai.ModerationMultiModalInputParamOfText("Text to classify goes here."),
openai.ModerationMultiModalInputParamOfImageURL(openai.ModerationImageURLInputImageURLParam{
URL: "https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg",
}),
},
},
})
if err != nil {
panic(err)
}
fmt.Println(moderation.Results[0].Flagged)
} 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.moderations.ModerationCreateParams;
import com.openai.models.moderations.ModerationImageUrlInput;
import com.openai.models.moderations.ModerationMultiModalInput;
import com.openai.models.moderations.ModerationTextInput;
import java.util.List;
var moderation =
client
.moderations()
.create(
ModerationCreateParams.builder()
.model("omni-moderation-latest")
.inputOfModerationMultiModalArray(
List.of(
ModerationMultiModalInput.ofText(
ModerationTextInput.builder()
.text("Text to classify goes here.")
.build()),
ModerationMultiModalInput.ofImageUrl(
ModerationImageUrlInput.builder()
.imageUrl(
ModerationImageUrlInput.ImageUrl.builder()
.url(
"https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg")
.build())
.build())))
.build());
System.out.println(moderation.results().get(0).flagged()); 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 using OpenAI.Moderations;
#pragma warning disable OPENAI001
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
string model = "omni-moderation-latest";
ModerationClient client = new(model, key);
ModerationResult result = await client.ClassifyInputsAsync(
[
ModerationInputPart.CreateTextPart("Text to classify goes here."),
ModerationInputPart.CreateImagePart(
new Uri(
"https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg"
)
),
]
);
Console.WriteLine($"Flagged: {result.Flagged}");
Console.WriteLine(
$"Violence: {result.Violence.Flagged}; score: {result.Violence.Score:F3}; inputs: {result.Violence.ApplicableInputKinds}"
); 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 require "openai"
client = OpenAI::Client.new
moderation = client.moderations.create(
model: OpenAI::Models::ModerationModel::OMNI_MODERATION_LATEST,
input: [
{
type: :text,
text: "Text to classify goes here."
},
{
type: :image_url,
image_url: {
url: "https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg"
}
}
]
)
puts(moderation.results.fetch(0).flagged) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 curl https://api.openai.com/v1/moderations \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "omni-moderation-latest",
"input": [
{ "type": "text", "text": "...text to classify goes here..." },
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.png"
}
}
]
}'
以下は、戦争映画の 1 フレームを画像として入力した場合の出力例の全文です。モデルは画像から暴力を示す要素を検出し、violence カテゴリのスコアは 0.8 を超えています。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 {
"id" : "modr-970d409ef3bef3b70c73d8232df86e7d" ,
"model" : "omni-moderation-latest" ,
"results" : [
{
"flagged" : true ,
"categories" : {
"sexual" : false ,
"sexual/minors" : false ,
"harassment" : false ,
"harassment/threatening" : false ,
"hate" : false ,
"hate/threatening" : false ,
"illicit" : false ,
"illicit/violent" : false ,
"self-harm" : false ,
"self-harm/intent" : false ,
"self-harm/instructions" : false ,
"violence" : true ,
"violence/graphic" : false
},
"category_scores" : {
"sexual" : 2.34135824776394e-7 ,
"sexual/minors" : 1.6346470245419304e-7 ,
"harassment" : 0.0011643905680426018 ,
"harassment/threatening" : 0.0022121340080906377 ,
"hate" : 3.1999824407395835e-7 ,
"hate/threatening" : 2.4923252458203563e-7 ,
"illicit" : 0.0005227032493135171 ,
"illicit/violent" : 3.682979260160596e-7 ,
"self-harm" : 0.0011175734280627694 ,
"self-harm/intent" : 0.0006264858507989037 ,
"self-harm/instructions" : 7.368592981140821e-8 ,
"violence" : 0.8599265510337075 ,
"violence/graphic" : 0.37701736389561064
},
"category_applied_input_types" : {
"sexual" : [ "image" ],
"sexual/minors" : [],
"harassment" : [],
"harassment/threatening" : [],
"hate" : [],
"hate/threatening" : [],
"illicit" : [],
"illicit/violent" : [],
"self-harm" : [ "image" ],
"self-harm/intent" : [ "image" ],
"self-harm/instructions" : [ "image" ],
"violence" : [ "image" ],
"violence/graphic" : [ "image" ]
}
}
]
}
JSON レスポンスには、入力に含まれるコンテンツがどのカテゴリに該当するかを示すフィールドと、各カテゴリの判定に対するモデルの確信度を示すフィールドがあります。
出力項目 説明 flaggedモデルがコンテンツを有害な可能性があると判定した場合は true、それ以外の場合は false になります。
categoriesカテゴリごとの違反フラグを格納した辞書です。モデルがそのカテゴリで違反を検出した場合は true、それ以外の場合は false になります。
category_scoresカテゴリごとのスコアを格納した辞書です。各スコアは、そのカテゴリに該当するコンテンツが入力に含まれるというモデルの確信度を表します。値の範囲は 0 から 1 で、値が大きいほど確信度が高くなります。
category_applied_input_types各カテゴリのスコアがどの入力タイプを対象としているかを示します。たとえば、violence/graphic カテゴリが画像とテキストの両方に適用された場合、violence/graphic プロパティの値は ["image", "text"] になります。
モデレーションエンドポイントで使用するモデルは継続的に更新する予定です。そのため、category_scores を基準にした独自のポリシーは、モデルの更新に応じて判定基準の再調整が必要になる場合があります。
以下の表に、モデレーションエンドポイントで検出できるコンテンツのカテゴリと、各カテゴリが対応する入力タイプを示します。
「テキストのみ」と記載されているカテゴリは画像入力に対応していません。テキストを添えずに画像だけを omni-moderation-latest モデルに送信すると、これらのカテゴリのスコアは 0 になります。画像ファイルのサイズ上限は 20 MB です。
カテゴリ 説明 入力タイプ harassment対象を問わず、嫌がらせの言葉を使ったり、その使用をあおったり、助長したりするコンテンツです。
テキストのみ harassment/threatening対象を問わず、相手に対する暴力や重大な危害も内容に含む嫌がらせのコンテンツです。
テキストのみ hate人種、ジェンダー、民族、宗教、国籍、性的指向、障害の有無、カーストを理由とする憎悪を表現したり、あおったり、助長したりするコンテンツです。保護対象ではない集団(チェスのプレイヤーなど)に対する憎悪を示すコンテンツは、嫌がらせに分類されます。
テキストのみ hate/threatening人種、ジェンダー、民族、宗教、国籍、性的指向、障害の有無、カーストを理由に特定の集団への憎悪を示し、その集団に対する暴力や重大な危害も内容に含むコンテンツです。
テキストのみ illicit違法行為の方法について助言や指示を与えるコンテンツです。たとえば「万引きの方法」という表現は、このカテゴリに該当します。
テキストのみ illicit/violentillicit カテゴリでフラグが付くコンテンツのうち、暴力や武器の入手にも言及しているものです。
テキストのみ self-harm自殺、自分の体を切る行為、摂食障害に伴う行為などの自傷行為を助長したり、勧めたり、描写したりするコンテンツです。
テキストと画像 self-harm/intent自殺、自分の体を切る行為、摂食障害に伴う行為などの自傷行為について、発言者が自分で行っている、または行うつもりだと表明するコンテンツです。
テキストと画像 self-harm/instructions自殺、自分の体を切る行為、摂食障害に伴う行為などの自傷行為を勧めたり、その方法について指示や助言を与えたりするコンテンツです。
テキストと画像 sexual性行為の描写など、性的興奮を引き起こすことを目的としたコンテンツ、または性的サービスを宣伝するコンテンツです。性教育や性の健康に関するコンテンツは除きます。
テキストと画像 sexual/minors18 歳未満の人物が登場する性的なコンテンツです。
テキストのみ violence死、暴力、または身体の負傷を描写するコンテンツです。 テキストと画像 violence/graphic死、暴力、または身体の負傷を生々しく詳細に描写するコンテンツです。
テキストと画像