跳到主要内容

📝🔬 泰语文本毒性分类

0.1 IC每400字符
✅ 活跃🗣️ NLP

欢迎使用艾艾普泰语文本毒性分类API,这是由艾艾普科技有限公司开发的一款人工智能产品。我们的API为泰语文本提供了强大的毒性检测能力,能够以高精度将内容分类为有毒和无毒类别。

试用演示

入门指南

  1. 先决条件

    • 艾艾普科技的API密钥
    • 泰语文本输入
    • 互联网连接
  2. 快速入门

    • 快速毒性分类
    • 高精度预测
    • 简单的REST API接口
  3. 主要功能

    • 二元分类(有毒,无毒)
    • 预测的置信度分数
    • 快速响应时间
    • 易于集成
  4. 安全与合规

    • 符合GDPR和PDPA规定
    • 处理后不保留数据
如何获取API密钥?

请访问API密钥管理页面查看您现有的API密钥或申请新的API密钥。

API 端点

端点方法描述费用
/v3/store/nlp/toxicity-classification
旧版: /toxic-classification/predict
POST将泰语文本分类为有毒或无毒每400个字符1个IC

示例

毒性分析请求

curl --location --request POST 'https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text=คณะนี้จบไปจะมีงานทำหรอ' \
--header 'apikey: {YOUR API KEY}'

毒性分析响应

有毒

{
"label": "toxic",
"score": 0.7037630677223206,
"input_text": "พนันกับคาสิโนออนไลน์",
"duration": 0.02465963363647461,
"message": "success",
"status_code": 200
}

无毒

{
"label": "non_toxic",
"score": 0.8708284497261047,
"input_text": "เขาเป็นคนดี ชอบช่วยเหลือผู้อื่น",
"duration": 0.03416180610656738,
"message": "success",
"status_code": 200
}

功能与能力

核心功能

  • 检测并将泰语文本分类为“有毒”或“无毒”。
  • 采用先进的自然语言处理(NLP)技术进行准确的毒性检测。
  • 支持在线平台进行主动的内容监控和审核。

支持的字段

  • 输入:用于毒性分类的泰语文本。
  • 输出:分类结果(有毒或无毒)。
  • 分类结果的置信度分数。

附加能力

  • 通过RESTful API轻松集成到现有应用程序。
  • 专为实时和批量处理设计,以适应各种用例。
  • 非常适合用于社交媒体审核、在线社区管理和增强内容安全的应用。

API 参考

端点

POST https://api.iapp.co.th/v3/store/nlp/toxicity-classification

查询参数

名称类型描述
textString泰语输入文本

请求头

名称类型描述
apikeyStringAPI密钥

代码示例

Curl

curl -X POST https://api.iapp.co.th/v3/store/nlp/toxicity-classification \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Your text here"}'

Python

import requests

url = "https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text={YOUR TEXT}"

payload = {}
headers = {
'apikey': '{YOUR API KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

JavaScript

const axios = require('axios');

let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text={YOUR TEXT}',
headers: {
'apikey': '{YOUR API KEY}'
}
};

axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text={YOUR%20TEXT}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => array(
'apikey: {YOUR API KEY}'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Swift

var request = URLRequest(url: URL(string: "https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text={YOUR%20TEXT}")!,timeoutInterval: Double.infinity)
request.addValue("{YOUR API KEY}", forHTTPHeaderField: "apikey")

request.httpMethod = "POST"

let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}

task.resume()

Kotlin

val client = OkHttpClient()
val mediaType = "text/plain".toMediaType()
val body = "".toRequestBody(mediaType)
val request = Request.Builder()
.url("https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text={YOUR TEXT}")
.post(body)
.addHeader("apikey", "{YOUR API KEY}")
.build()
val response = client.newCall(request).execute()

Java

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text={YOUR TEXT}")
.method("POST", body)
.addHeader("apikey", "{YOUR API KEY}")
.build();
Response response = client.newCall(request).execute();

Dart

var headers = {
'apikey': '{YOUR API KEY}'
};
var request = http.Request('POST', Uri.parse('https://api.iapp.co.th/v3/store/nlp/toxicity-classification?text={YOUR TEXT}'));

request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}

定价

AI API 服务名称端点每字符IC本地部署
文本毒性分类 [v1.0]toxic-classification1 IC/400 字符联系我们