The sentiment array in a Semantic Event is a powerful feature for capturing opinions, feelings, and attitudes expressed within the event's content. It allows you to systematically track and analyze subjective information, turning unstructured text from emails, support tickets, or reviews into structured, actionable data.
This analysis can be performed automatically by the Context Suite platform. Using Large Language Models (LLMs), incoming events with text content can be analyzed in real-time to detect and classify expressions of sentiment. This means you don't always have to provide the sentiment object yourself; you can send an event with raw text, and the enriched event will contain the structured sentiment data.
The Sentiment Object
Each object within the sentiment array describes a single expression of sentiment. An event can contain multiple sentiment objects if different opinions are expressed.
| Property | Description | Provided By |
|---|---|---|
type | The type of sentiment expressed. Common values include Praise, Criticism, Complaint, or Opinion. | User-Provided |
sentiment | A short description of the sentiment itself (e.g., "Positive Experience", "Product Defect"). | User-Provided |
reason | The specific reasoning or text snippet that justifies the sentiment classification. | User-Provided (Optional) |
target_entity | The specific thing the sentiment is about (e.g., "Customer Service", "iPhone 15 Pro"). | User-Provided (Optional) |
target_category | A broader category for the target (e.g., "Service", "Product"). | User-Provided (Optional) |
target_type | A more specific type for the target (e.g., "Support Agent", "Mobile Phone"). | User-Provided (Optional) |
entity_type | The type of the entity the sentiment is about (e.g., Person, Product). | User-Provided (Optional) |
id | The specific ID of the entity being discussed. | User-Provided (Optional) |
id_type | The system or authority that issued the id (e.g., Shopify, Zendesk). | User-Provided (Optional) |
entity_gid | The Context Suite Graph ID (UUID) for the entity, if known. | Auto-Populated |
Example: Automatic Sentiment Detection
Imagine a customer sends an email to your support address. You can capture this as a single track event using the Jitsu client library, providing the raw content of the email.
1. The Initial jitsu.track Event
Here, we send an event containing the subject and body of an email. No sentiment is provided by the user.
1jitsu.track('Support Email Received', {
2 content: {
3 subject: "My new headphones are broken!",
4 body: "I received my order yesterday and the right headphone on the SonicWave Pro headset doesn't produce any sound. I'm really disappointed with the quality. I need a replacement immediately."
5 },
6 involves: [
7 {
8 role: "Product",
9 entity_type: "Product",
10 id: "PROD-12345",
11 id_type: "InternalSKU",
12 label: "SonicWave Pro"
13 }
14 ]
15});2. The Enriched Event with Sentiment
After the Context Suite platform processes this event, it automatically analyzes the content and adds a structured sentiment object. The final event stored in the system would look like this, with the new section added by the AI.
1{
2 "event": "Support Email Received",
3 "type": "track",
4 "content": {
5 "subject": "My new headphones are broken!",
6 "body": "I received my order yesterday and the right headphone on the SonicWave Pro headset doesn't produce any sound. I'm really disappointed with the quality. I need a replacement immediately."
7 },
8 "involves": [
9 {
10 "role": "Product",
11 "entity_type": "Product",
12 "id": "PROD-12345",
13 "id_type": "InternalSKU",
14 "label": "SonicWave Pro"
15 }
16 ],
17 "sentiment": [
18 {
19 "type": "Complaint",
20 "sentiment": "Product Defective",
21 "reason": "The right headphone... doesn't produce any sound.",
22 "target_entity": "SonicWave Pro",
23 "target_category": "Product",
24 "entity_type": "Product",
25 "id": "PROD-12345",
26 "id_type": "InternalSKU"
27 },
28 {
29 "type": "Criticism",
30 "sentiment": "Poor Quality",
31 "reason": "I'm really disappointed with the quality.",
32 "target_entity": "SonicWave Pro",
33 "target_category": "Product Quality",
34 "entity_type": "Product",
35 "id": "PROD-12345",
36 "id_type": "InternalSKU"
37 }
38 ],
39 // ... other enriched properties
40}This automated process transforms raw, unstructured feedback into valuable data points that can be used to trigger alerts, populate dashboards tracking product quality, and measure overall customer satisfaction without manual intervention.
The sentiment analysis works hand-in-hand with other Context Suite features like entity_linking to identify what the sentiment is about, and classification to categorize the type of feedback received.