Perform line by line sentiment analysis on any text with detailed emotion detection.
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.sentiment({
"text": "I love this product! It's amazing but the delivery was a bit late."
})
{
"success": true,
"sentiment": {
"emotion": "love",
"sentiment": "positive",
"score": 0.85,
"sentences": [
{
"text": "I love this product!",
"emotion": "love",
"sentiment": "positive",
"score": 0.9
},
{
"text": "It's amazing but the delivery was a bit late.",
"emotion": "neutral",
"sentiment": "positive",
"score": 0.8
}
]
},
"_usage": {
"input_tokens": 20,
"output_tokens": 74,
"inference_time_tokens": 2429,
"total_tokens": 2523
}
}
Hide Sentiment Object Structure
anger
fear
sadness
happiness
anxiety
disgust
embarrassment
love
surprise
shame
envy
satisfaction
self-confidence
annoyance
boredom
hatred
compassion
guilt
loneliness
depression
pride
neutral
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.sentiment({
"text": "I love this product! It's amazing but the delivery was a bit late."
})
{
"success": true,
"sentiment": {
"emotion": "love",
"sentiment": "positive",
"score": 0.85,
"sentences": [
{
"text": "I love this product!",
"emotion": "love",
"sentiment": "positive",
"score": 0.9
},
{
"text": "It's amazing but the delivery was a bit late.",
"emotion": "neutral",
"sentiment": "positive",
"score": 0.8
}
]
},
"_usage": {
"input_tokens": 20,
"output_tokens": 74,
"inference_time_tokens": 2429,
"total_tokens": 2523
}
}
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.sentiment({
"text": "I love this product! It's amazing but the delivery was a bit late."
})
{
"success": true,
"sentiment": {
"emotion": "love",
"sentiment": "positive",
"score": 0.85,
"sentences": [
{
"text": "I love this product!",
"emotion": "love",
"sentiment": "positive",
"score": 0.9
},
{
"text": "It's amazing but the delivery was a bit late.",
"emotion": "neutral",
"sentiment": "positive",
"score": 0.8
}
]
},
"_usage": {
"input_tokens": 20,
"output_tokens": 74,
"inference_time_tokens": 2429,
"total_tokens": 2523
}
}