百度AI开放平台地址:点击跳转
官方文档地址:点击跳转
获取应用
1.进行注册登陆
2.找到文字识别–>应用列表
3.创建应用
4.获取AppID,API Key,Secret Key

安装百度AI模块
对文本进行错误检查
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| from aip import AipNlp
appip = 'your appid' appkey = 'your appkey' secret_key = 'your secret_key'
client = AipNlp(appip,appkey,secret_key)
text = '学习python,学习人工只能'
res = client.ecnet(text) print(res)
|
对文本进行标签处理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| from aip import AipNlp
appip = 'your appid' appkey = 'your appkey' secret_key = 'your secret_key'
client = AipNlp(appip,appkey,secret_key)
title = 'python人工智能在线学习' content = '我再北京学习人工智能,他是基于python的一门学科'
res = client.keyword(title,content) print(res)
|
对文本进行情感分析
1 2 3 4 5 6 7 8 9 10 11 12 13
| from aip import AipNlp
appip = 'your appid' appkey = 'your appkey' secret_key = 'your secret_key'
client = AipNlp(appip,appkey,secret_key)
text = '华为是一家很棒的公司' print(client.commentTag(text))
|