Recipe catalog / review-facets
Label the aspects of a product review
review-facets is a Jev recipe from the jev-recipes TypeScript package. Which of these does review comment on: quality, price, shipping, service, or a defect? Use it when you need to tag product reviews by the aspects they discuss in one call, for aspect-level ratings, routing defect reports, or filtering review feeds.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use review-facets in TypeScript?
Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.
import { reviewFacets } from 'jev-recipes/review-facets';
const result = await reviewFacets({
"review": "The blender itself is solid and crushes ice with no trouble, and for the sale price it was a steal. Unfortunately the box arrived dented and the lid gasket was torn, so it leaks. Support sent a replacement gasket within two days, which I appreciated.",
"minConfidence": 0.8
});
console.log(result);
What input does review-facets take?
| Field | Type | Needed |
|---|---|---|
| review | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"review": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"review"
]
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"model": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"input_tokens",
"output_tokens"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"detected": {
"type": "array",
"items": {
"type": "string",
"enum": [
"mentionsQuality",
"mentionsPrice",
"mentionsShipping",
"mentionsService",
"reportsDefect"
]
}
},
"labels": {
"type": "object",
"properties": {
"mentionsQuality": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"mentionsPrice": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"mentionsShipping": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"mentionsService": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"reportsDefect": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
}
},
"required": [
"mentionsQuality",
"mentionsPrice",
"mentionsShipping",
"mentionsService",
"reportsDefect"
],
"additionalProperties": false
}
},
"required": [
"model",
"usage",
"status",
"detected",
"labels"
],
"additionalProperties": false
}
}What does a review-facets result look like?
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo review-facets.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"detected": [
"mentionsQuality",
"mentionsPrice",
"mentionsShipping",
"mentionsService",
"reportsDefect"
],
"labels": {
"mentionsQuality": {
"status": "ready",
"verdict": "present",
"probability": 0.95,
"confidence": 0.95
},
"mentionsPrice": {
"status": "ready",
"verdict": "present",
"probability": 0.93,
"confidence": 0.93
},
"mentionsShipping": {
"status": "ready",
"verdict": "present",
"probability": 0.88,
"confidence": 0.88
},
"mentionsService": {
"status": "ready",
"verdict": "present",
"probability": 0.96,
"confidence": 0.96
},
"reportsDefect": {
"status": "ready",
"verdict": "present",
"probability": 0.94,
"confidence": 0.94
}
}
}
Input
See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.
Result
labels holds one check per aspect: mentionsQuality, mentionsPrice, mentionsShipping, mentionsService, and reportsDefect. Each check has a verdict of present or absent, the yes probability, confidence for the chosen side, and its own status. detected lists the present aspects in declaration order.
The overall status is review when any single label falls below minConfidence. Labels that are individually ready remain usable in that case.
Reuse and calls
Uses the shared labels helper, which places one yes/no question per aspect in a single Jev request. This folder owns the five questions and their outcome descriptions. A live invocation makes one logical Jev request.
Limits
Each aspect is judged independently, so combinations are expected. The labels report which aspects the review discusses, not the sentiment toward them; a glowing comment about price and a complaint about price both set mentionsPrice. reportsDefect requires a specific broken, damaged, or malfunctioning product, so general disappointment without a described fault is absent. For the single dominant kind of a piece of feedback use feedback-kind.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo review-facets shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe review-facets to inspect the input and result schemas.
How accurate is review-facets?
No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.
Use the evaluation guide to measure this decision on your own labeled cases.
What are the limits of review-facets?
- Labels are independent, so a review can carry several or none.
- Labels say which aspects are mentioned, not whether the comment is positive or negative.
Which recipes are related to review-facets?
- feedback-kind: Use feedback-kind when you need the single primary kind of a piece of feedback.
- issue-impact: Use issue-impact to grade how badly a reported defect blocks the customer.