-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Context
Currently, the Sentiment API returns only the overall average of emotions across the entire video, in the following format:
{
"emotions": {
"Angry": 15.38,
"Disgusted": 7.69,
"Fearful": 0.0,
"Happy": 0.0,
"Neutral": 53.85,
"Sad": 23.08,
"Surprised": 0.0
}
}This is not enough for the frontend, which needs to build an emotional timeline throughout the video.
Problem
- There is no information about when each emotion occurs
- It is not possible to render charts or timelines
- A global average loses important temporal context
Proposal
In addition to the overall average, the API should return a time-based array segmented by fixed intervals.
Expected payload
{
"average_emotions": {
"Angry": 15.38,
"Disgusted": 7.69,
"Fearful": 0.0,
"Happy": 0.0,
"Neutral": 53.85,
"Sad": 23.08,
"Surprised": 0.0
},
"timeline": [
{
"id": 1,
"starting_time": "00:00",
"ending_time": "00:10",
"emotion": "SURPRISED",
"value": 54
},
{
"id": 2,
"starting_time": "00:10",
"ending_time": "00:20",
"emotion": "NEUTRAL",
"value": 62
}
]
}Requirements
- Configurable time intervals (e.g. 5s, 10s) or when change the dominant emotion
- Dominant emotion per interval
valuerepresenting intensity/confidence (%)- Maintain backward compatibility (overall average must still be returned)
Benefits
- Enables emotion timeline visualization on the frontend
- Provides richer context for UX analysis
- Data can be reused for charts and insights
Note
The frontend is already prepared to consume this format.