Overview
Classify text against custom criteria. It analyzes your text and provides scores (0-100) for each specified criterion, indicating how well the text matches each criteria.
Use This Action To
- Evaluate text against custom criteria
- Score content based on specific attributes
- Classify documents by custom metrics
- Measure how well text matches defined criteria
Parameters
Text to classify (max 5,000 characters)
Array of criteria names to evaluate the text against
Example
curl -X POST https://whetdata.com/api/classify \
-H "x-api-key: whet_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"text": "This is a great product with awesome features",
"criteria": ["is_positive"]
}'
const url = "https://whetdata.com/api/classify";
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "whet_your_api_key_here",
},
body: JSON.stringify({
text: "This is a great product with awesome features",
criteria: ["is_positive"],
}),
};
fetch(url, options)
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
Response
{
"success": true,
"scores": {
"is_positive": 100,
"would_order_again": 100,
"mentions_taste": 100,
"is_actionable": 1
}
}
Tips
The maximum text length is 5,000 characters. For longer texts, split them into
chunks.
Text to classify (max 5,000 characters)
Maximum string length: 5000
Array of criteria names to evaluate the text against
Scores for each criterion (0-100)