OpenAI のモデレーションモデルを使用して、テキストや画像に含まれる有害なコンテンツを検出できます。モデレーションエンドポイント で入力を単独で分類したり、生成レスポンスとともにモデレーションスコアをリクエストしたりできます。その結果を使って、コンテンツのフィルタリング、リクエストのレビューへの振り分け、フラグが付いたコンテンツを送信したアカウントへの対応など、アプリケーションのポリシーを適用します。
omni-moderation-latest モデルは、テキストと画像の入力を受け付けます。音声は分類しません。モデレーションエンドポイントは無料で利用でき、画像ファイルは最大 20 MB まで対応しています。
子どもの安全: 児童性的虐待コンテンツ(CSAM)に該当することが確認されているものや、その疑いがあるものをモデレーション 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 は、モデレーション結果のコンテナを 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死亡、暴力、または身体的な負傷を生々しく詳細に描写するコンテンツです。
テキストと画像