İçerik Moderasyonu
curl --request POST \
--url https://dev-api.detectivision.ai/api/v1/moderation \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "text_moderation",
"input": "selam"
}
'import requests
url = "https://dev-api.detectivision.ai/api/v1/moderation"
payload = {
"type": "text_moderation",
"input": "selam"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'text_moderation', input: 'selam'})
};
fetch('https://dev-api.detectivision.ai/api/v1/moderation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-api.detectivision.ai/api/v1/moderation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'text_moderation',
'input' => 'selam'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-api.detectivision.ai/api/v1/moderation"
payload := strings.NewReader("{\n \"type\": \"text_moderation\",\n \"input\": \"selam\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-api.detectivision.ai/api/v1/moderation")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"text_moderation\",\n \"input\": \"selam\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-api.detectivision.ai/api/v1/moderation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"text_moderation\",\n \"input\": \"selam\"\n}"
response = http.request(request)
puts response.read_body{
"id": 25,
"jobId": 122,
"result": {
"language": "tr",
"scores": {
"NEUTRAL": 0.9886459112167358,
"SEXUAL": 0.0022032149136066437,
"HATE": 0.001250135712325573,
"SELF_HARM": 0.001079669571481645,
"BAD_HABITS": 0.00073793507181108
},
"flags": {
"NEUTRAL": true,
"SEXUAL": false,
"HATE": false,
"SELF_HARM": false,
"BAD_HABITS": false
}
},
"createdAt": 1742201764,
"updatedAt": 1742201764
}{
"error": "invalid_request",
"message": "Geçersiz istek parametreleri"
}{
"error": "invalid_request",
"message": "Geçersiz istek parametreleri"
}Content Moderation
İçerik Moderasyonu
Metin içeriğini analiz ederek içerikteki zararlı ifadeleri tespit eder
POST
/
moderation
İçerik Moderasyonu
curl --request POST \
--url https://dev-api.detectivision.ai/api/v1/moderation \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "text_moderation",
"input": "selam"
}
'import requests
url = "https://dev-api.detectivision.ai/api/v1/moderation"
payload = {
"type": "text_moderation",
"input": "selam"
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'text_moderation', input: 'selam'})
};
fetch('https://dev-api.detectivision.ai/api/v1/moderation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-api.detectivision.ai/api/v1/moderation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'text_moderation',
'input' => 'selam'
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-api.detectivision.ai/api/v1/moderation"
payload := strings.NewReader("{\n \"type\": \"text_moderation\",\n \"input\": \"selam\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-api.detectivision.ai/api/v1/moderation")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"text_moderation\",\n \"input\": \"selam\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-api.detectivision.ai/api/v1/moderation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"text_moderation\",\n \"input\": \"selam\"\n}"
response = http.request(request)
puts response.read_body{
"id": 25,
"jobId": 122,
"result": {
"language": "tr",
"scores": {
"NEUTRAL": 0.9886459112167358,
"SEXUAL": 0.0022032149136066437,
"HATE": 0.001250135712325573,
"SELF_HARM": 0.001079669571481645,
"BAD_HABITS": 0.00073793507181108
},
"flags": {
"NEUTRAL": true,
"SEXUAL": false,
"HATE": false,
"SELF_HARM": false,
"BAD_HABITS": false
}
},
"createdAt": 1742201764,
"updatedAt": 1742201764
}{
"error": "invalid_request",
"message": "Geçersiz istek parametreleri"
}{
"error": "invalid_request",
"message": "Geçersiz istek parametreleri"
}İçerik Moderasyonu API’si
Bu endpoint, metinlerde zararlı içerik olup olmadığını kontrol eder ve ayrıntılı bir analiz sonucu döndürür.Kullanım Senaryoları
- Kullanıcı yorumlarının platformunuza uygun olup olmadığını denetlemek
- Forum gönderilerini otomatik olarak moderasyon sürecinden geçirmek
- Eğitim içeriklerinin güvenliğini sağlamak
- Sosyal medya etkileşimlerini analiz etmek
Sınıflandırma Kategorileri
API yanıtındaki skorlar ve bayraklar, metni aşağıdaki kategorilerde değerlendirir:| Kategori | Açıklama |
|---|---|
| NEUTRAL | İçeriğin zararlı olmadığı anlamına gelir |
| SEXUAL | Cinsel içerik tespiti |
| HATE | Nefret söylemi tespiti |
| SELF_HARM | Kendine zarar vermeyle ilgili içerik tespiti |
| BAD_HABITS | Zararlı alışkanlıklarla ilgili içerik tespiti |
Skor Değerlerine Göre Yorumlama
- 0.0 - 0.3: Düşük risk
- 0.3 - 0.7: Orta risk
- 0.7 - 1.0: Yüksek risk
Authorizations
Body
application/json
Response
Başarılı analiz sonucu