Google의 안전 필터를 테스트하고 비즈니스에 맞는 신뢰도 기준을 정의할 수 있습니다. 이러한 기준을 사용하면 Google의 사용 정책 또는 서비스 약관을 위반하는 콘텐츠를 감지하고 적절한 조치를 취할 수 있습니다.
신뢰도 점수는 예측일 뿐입니다. 안정성 또는 정확성을 위해 점수에 의존해서는 안 됩니다. Google은 비즈니스 결정을 위해 이러한 점수를 해석하거나 사용할 책임이 없습니다.
가능성과 심각도의 차이점
신뢰도 점수는 콘텐츠가 심각도가 아닌 지정된 카테고리에 속해 있음을 나타냅니다. 일부 콘텐츠는 심각도의 유해성이 높더라도 안전하지 않을 가능성이 낮을 수 있으므로 이를 고려하는 것이 중요합니다. 예를 들어 다음 문장을 비교해보겠습니다.
로봇이 나를 때렸습니다.
로봇이 나를 베었습니다.
문장 1은 안전하지 않을 가능성이 더 높을 수 있지만 폭력 측면에서는 문장 2가 더 심각하다고 생각할 수 있습니다.
따라서 최종 사용자에 대한 해를 최소화하면서 사용 사례에 적합한 차단 수준을 신중하게 테스트하고 고려하는 것이 중요합니다.
언어 지원
언어
ISO-639-1
지원
영어
es
예
스페인어
es
예
포르투갈어
pt
예
프랑스어
fr
예
이탈리아어
it
예
독일어
de
예
중국어
zh
예
일본어
ja
예
한국어
ko
예
네덜란드어
nl
제한됨
러시아어
ru
제한됨
힌디어
hi
제한됨
인도네시아어
id
제한됨
아랍어
ar
제한됨
텍스트 검토 방법
이 섹션에서는 문서에서 텍스트를 검토하는 방법을 보여줍니다.
문서마다 별도의 요청을 제출해야 합니다.
다음은 문자열로 제공된 텍스트를 검토하는 예입니다.
프로토콜
문서에서 콘텐츠를 검토하려면 documents:moderateText REST 메서드에 POST 요청을 하고 다음 예시와 같이 적절한 요청 본문을 제공해야 합니다.
이 예시에서는 gcloud auth application-default print-access-token 명령어를 사용하여 Google Cloud Platform gcloud CLI를 사용하는 프로젝트용으로 설정된 서비스 계정에 대한 액세스 토큰을 얻습니다.
gcloud CLI를 설치하고 서비스 계정을 통해 프로젝트를 설정하는 방법에 대한 안내는 빠른 시작을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-01-23(UTC)"],[],[],null,["# Moderate text\n\n**Text moderation** analyzes a document against a list of\nsafety attributes, which include \"harmful categories\" and topics that may be considered sensitive. To moderate\nthe text in a document, call the [`moderateText`](/natural-language/reference/rest/v1/documents/moderateText) method.\n\nA complete list of categories returned for the [`moderateText`](/natural-language/reference/rest/v1/documents/moderateText)\nmethod are found here:\n\n#### Safety attribute confidence scores\n\nEach safety attribute has an associated confidence score\nbetween 0.00 and 1.00, reflecting the likelihood of\nthe input or response belonging to a given category.\n\n**Sample response** \n\n {\n \"moderationCategories\": [\n {\n \"name\": \"Toxic\",\n \"confidence\": 0.10\n },\n {\n \"name\": \"Insult\",\n \"confidence\": 0.12\n },\n {\n \"name\": \"Profanity\",\n \"confidence\": 0.07\n },\n {\n \"name\": \"Derogatory\",\n \"confidence\": 0.04\n },\n {\n \"name\": \"Sexual\",\n \"confidence\": 0.00\n },\n {\n \"name\": \"Death, Harm & Tragedy\",\n \"confidence\": 0.00\n },\n {\n \"name\": \"Violent\",\n \"confidence\": 0.00\n },\n {\n \"name\": \"Firearms & Weapons\",\n \"confidence\": 0.00\n },\n {\n \"name\": \"Public Safety\",\n \"confidence\": 0.01\n },\n {\n \"name\": \"Health\",\n \"confidence\": 0.01\n },\n {\n \"name\": \"Religion & Belief\",\n \"confidence\": 0.00\n },\n {\n \"name\": \"Illicit Drugs\",\n \"confidence\": 0.01\n },\n {\n \"name\": \"War & Conflict\",\n \"confidence\": 0.02\n },\n {\n \"name\": \"Politics\",\n \"confidence\": 0.01\n },\n {\n \"name\": \"Finance\",\n \"confidence\": 0.00\n },\n {\n \"name\": \"Legal\",\n \"confidence\": 0.00\n }\n ]\n }\n\n**Test your confidence thresholds**\n\nYou can test Google's safety filters and define confidence thresholds that are\nright for your business. By using these thresholds, you can take comprehensive\nmeasures to detect content that violates Google's usage policies or terms of\nservice and take appropriate action.\n\nThe confidence scores are only predictions. You shouldn't depend on the\nscores for reliability or accuracy. Google is not responsible for interpreting\nor using these scores for business decisions.\n\n**Difference between probability and severity**\n\nThe confidence scores indicate that\nthe content belongs to the specified category and not the severity. This is important to\nconsider because some content can have low probability of being unsafe even\nthough the severity of harm could still be high. For example, comparing the\nsentences:\n\n1. The robot punched me.\n2. The robot slashed me up.\n\nSentence 1 might cause a higher probability of being unsafe but you might\nconsider sentence 2 to be a higher severity in terms of violence.\n\nTherefore, it is important for you to carefully test and consider what the\nappropriate level of blocking is for your use cases while\nminimizing harm to end users.\n\n**Language support**\n\n| **Note:** The API does not have a hard restriction on language support, so unlisted languages will still return predictions. We cannot verify the quality of predictions for unlisted languages. Similarly, \"limited\" support means results may vary by type of text (eg. webpage, chat message, etc) for some attributes. In any case, we recommend thorough evaluation for your use case.\n\n### How to moderate text\n\nThis section demonstrates how to moderate text in a document.\nYou need to submit a separate request for each document.\n\nHere is an example of moderating text provided as a string: \n\n### Protocol\n\nTo moderate content from a document, make a `POST` request to the\n[`documents:moderateText`](/natural-language/docs/reference/rest/v1/documents/moderateText)\nREST method and provide\nthe appropriate request body as shown in the following example.\n\nThe example uses the `gcloud auth application-default print-access-token`\ncommand to obtain an access token for a service account set up for the\nproject using the Google Cloud Platform [gcloud CLI](https://cloud.google.com/sdk/).\nFor instructions on installing the gcloud CLI,\nsetting up a project with a service account\nsee the [Quickstart](/natural-language/docs/setup). \n\n```bash\ncurl -X POST \\\n -H \"Authorization: Bearer \"$(gcloud auth application-default print-access-token) \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n --data \"{\n 'document':{\n 'type':'PLAIN_TEXT',\n 'content':'Shut up!'\n }\n}\" \"https://language.googleapis.com/v1/documents:moderateText\"\n```\n\n\u003cbr /\u003e\n\n#### Moderate text from Cloud Storage\n\nHere is an example of moderating text stored in a text file on Cloud Storage: \n\n### Protocol\n\nTo moderate text from a document stored in Cloud Storage,\nmake a `POST` request to the\n[`documents:moderateText`](/natural-language/docs/reference/rest/v1/documents/moderateText)\nREST method and provide\nthe appropriate request body with the path to the document\nas shown in the following example. \n\n```bash\ncurl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth application-default print-access-token)\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n https://language.googleapis.com/v1/documents:moderateText -d \"{\n 'document':{\n 'type':'PLAIN_TEXT',\n 'gcsContentUri':'gs://\u003cvar translate=\"no\"\u003e<bucket-name>\u003c/var\u003e/\u003cvar translate=\"no\"\u003e<object-name>\u003c/var\u003e'\n }\n}\"\n```\n\n\u003cbr /\u003e"]]