Watson Natural Language Understanding
用于高级文本分析的自然语言处理
- 认证方式
- OAuth
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 文本分析
简介
IBM Watson Natural Language Understanding 分析文本——情感、实体、关键词、分类和情绪。认证是 IBM Cloud API 密钥(未认证请求返回 401,已实测)。
快速开始
获取 IBM Cloud API 密钥,然后(替换 YOUR_KEY):
curl -X POST "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com/v1/analyze?version=2022-04-07" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{"text": "I love this product!", "features": {"sentiment": {}}}'
{ "usage": { "text_characters": 19, "features": 1 }, "sentiment": { "document": { "score": 0.9, "label": "positive" } } }
认证方式
- 在 cloud.ibm.com 注册 → 创建 Natural Language Understanding 实例 → API 密钥。
- 获取 IAM 令牌:
curl -X POST https://iam.cloud.ibm.com/identity/token -d "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=YOUR_KEY"→access_token。 - 通过
Authorization: Bearer {token}携带(缺失 → 401,已实测)。
速率限制与注意事项
- 免费层:30,000 个 NLU 条目/月(以文档为准);付费档可扩展。
- 功能:情感、实体、关键词、分类、概念、情绪、关系。
version=YYYY-MM-DD查询参数必填。
常见问题
Watson NLU 免费吗? 免费层:30,000 条目/月;更多需要付费。
如何获取密钥? IBM Cloud → 创建 NLU 实例 → API 密钥。
认证流程是什么? 先把 API 密钥换成 IAM bearer 令牌。
文本分析 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| apilayer languagelayer Language Detection JSON API supporting 173 languages | OAuth | Yes | Unknown | ↗ |
| Audexum Text-to-speech REST API with 43 voices and 33 languages | API Key | Yes | Yes | ↗ |
| Aylien Text Analysis A collection of information retrieval and natural language APIs | API Key | Yes | Unknown | ↗ |
| Cloudmersive Natural Language Processing Natural language processing and text analysis | API Key | Yes | Yes | ↗ |
| Code Detection Detect, label, format and enrich the code in your app or in your data pipeline | OAuth | Yes | Unknown | ↗ |