协同分类(Co.Classify)
开发环境
开发环境
POST
https://api.cohere.ai/v1/classify
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.cohere.ai/v1/classify' \
--header 'Content-Type: application/json' \
--data-raw '{
"truncate": "END",
"inputs": [
"Confirm your email address",
"hey i need u to send some $"
],
"examples": [
{
"text": "Dermatologists don'\''t like her!",
"label": "Spam"
},
{
"text": "Hello, open to this?",
"label": "Spam"
},
{
"text": "I need help please wire me $1000 right now",
"label": "Spam"
},
{
"text": "Nice to know you ;)",
"label": "Spam"
},
{
"text": "Please help me?",
"label": "Spam"
},
{
"text": "Your parcel will be delivered today",
"label": "Not spam"
},
{
"text": "Review changes to our Terms and Conditions",
"label": "Not spam"
},
{
"text": "Weekly sync notes",
"label": "Not spam"
},
{
"text": "Re: Follow up from today’s meeting",
"label": "Not spam"
},
{
"text": "Pre-read for tomorrow",
"label": "Not spam"
}
]
}'
响应示例响应示例
{
"id": "string",
"classifications": [
{
"id": "string",
"input": "string",
"prediction": "string",
"predictions": [
"string"
],
"confidence": 0,
"confidences": [
0
],
"labels": {
"Not spam": {
"confidence": 0
},
"Spam": {
"confidence": 0
}
},
"classification_type": "string"
}
],
"meta": {
"api_version": {
"version": "string"
}
}
}
请求参数
Body 参数application/json
返回响应
修改于 2023-10-31 08:23:52