百度云内容审核java api
1.pom
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.12.0</version>
</dependency>
2.文本内容审核检测案例
import com.baidu.aip.contentcensor.AipContentCensor;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
public class Test{
public static final String APP_ID = "...";
public static final String API_KEY = "...";
public static final String SECRET_KEY = "...";
public static boolean discernSensitiveWords(String text) {
AipContentCensor contentCensorClient = new AipContentCensor(APP_ID, API_KEY, SECRET_KEY);
contentCensorClient.setConnectionTimeoutInMillis(2000);
contentCensorClient.setSocketTimeoutInMillis(60000);
String resp;
try {
resp = contentCensorClient.textCensorUserDefined(URLDecoder.decode(text, "UTF-8")).toString();
System.out.println(resp);
} catch (UnsupportedEncodingException e) {
return false;
}
return false;
}
public static void main(String[] args) throws Exception{
String text="你是个sb吗";
discernSensitiveWords(text);
}
}
具体请参考百度内容审核文档https://cloud.baidu.com/doc/ANTIPORN/s/Vk3h6xaga
猜你喜欢
file
java jdk 1.8中文api文档
java api
109
java jdk 1.8中文api文档
mq jms api
161
点击右上角下载按钮下载
blog
极光推送java api
工具
293
引入pom文件 dependency groupIdcn.jpush.api/groupId artifactIdjpush-client/artifactId version3.2.17/version /dependency dependency groupIdcn.jpush.api/groupId artifactIdjiguang-common/artifactId
weblog
100
报错信息javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIXpathbuildingfailed:sun.security.provider.certpath.SunCertPathBuilderException:unabletofindvalidcertificationpathto
file
许巍歌曲36首(百度云)
歌曲 音乐 许巍
602
百度云链接:https://pan.baidu.com/s/1e9fQaNo7hLLnAnT6YNAg0g提取码:xw7r
html
350
iframe自适应高度+iframe动态写入内容+iframe图片懒加载
java虚拟机(jvm)
5330
Java虚拟机栈都包含那些东西在阅读过深入理解java虚拟机以后了解到java虚拟机栈包括栈帧、局部变量表、操作数栈、动态链接、方法返回等。Java虚拟机栈都储存那些内容呢一般包括基本数据类型,和对
file
百度网络图片文字识别demo
百度api
215
百度文档:https://ai.baidu.com/ai-doc/OCR/Sk3h7xyadimportjava.io.BufferedInputStream
最近发表
归档
2018年11月
12
2018年12月
33
2019年01月
28
2019年02月
28
2019年03月
32
2019年04月
27
2019年05月
33
2019年06月
6
2019年07月
12
2019年08月
12
2019年09月
21
2019年10月
8
2019年11月
15
2019年12月
25
2020年01月
9
2020年02月
5
2020年03月
16
2020年04月
4
2020年06月
1
2020年07月
7
2020年08月
13
2020年09月
9
2020年10月
4
标签
算法基础
linux
前端
c++
数据结构
框架
数据库
计算机基础
储备知识
java基础
ASM
其他
深入理解java虚拟机
nginx
git
undefined
undefined
sdf
sdf
dsdf
sdfasdfasd
sdf
ppp
sdf
fggdgsd
kkk
kkk
kkk
sdddf
456