Stanford EduNLP Lab org
No description provided.
Stanford EduNLP Lab org
•
This comment has been hidden
Stanford EduNLP Lab org

Talk time: frontend usage

The endpoint now returns talk metrics measured in seconds, alongside the existing word-count metrics. I didn't change how any existing field behaves, so frontend needs to link the new time-based fields.

Input

Each item in inputs can be a row from the transcript CSV as-is:

{"utterance_index": 7, "speaker_uid": "7b90bc03…", "start_time": 151.283, "end_time": 151.646,
 "utterance_text": "Thank you.", "speaker_id_confidence": 0.9568}

The old format (uid, speaker, text, starttime, endtime) still works. Set parameters.uptake_speaker to the teacher's speaker_uid.

Session-level fields

Field Use it for Example
talkTimeDistribution Teacher vs student share of talk time, in % (adds up to 100) {"teacher": 93, "student": 7}
talkTimeTotal Total seconds spoken per role {"teacher": 2012.75, "student": 149.24}
talkTimeLength Average seconds per utterance {"teacher": 10.65, "student": 1.3}
sessionDuration Seconds from first start to last end of the timed utterances. Use as the denominator for "share of class time" (includes silence) 3941.88
talkTimeUntimedUtterances Number of utterances skipped because they have no timestamps 0
talkTimeBySpeaker Per-speaker breakdown, keyed by speaker_uid see below
"talkTimeBySpeaker": {
  "7b90bc03…": {"role": "teacher", "seconds": 2012.75, "timedUtterances": 189, "untimedUtterances": 0, "avgConfidence": 0.9358},
  "57466d42…": {"role": "student", "seconds": 92.06,   "timedUtterances": 80,  "untimedUtterances": 0, "avgConfidence": 0.2946},
  "unknown":   {"role": "student", "seconds": 39.0,    "timedUtterances": 72,  "untimedUtterances": 0, "avgConfidence": 0.4938}
}

To compute per-speaker shares, use seconds. Decide whether to leave out the unknown entry before dividing.

When data is missing:

  • Utterances without timestamps are skipped in all time fields and counted in talkTimeUntimedUtterances and in each speaker's untimedUtterances. If those counts are non-zero, the seconds are an undercount for that speaker. Consider showing a warning rather than hiding the numbers.
  • No uptake_speaker: talkTimeDistribution, talkTimeTotal and talkTimeLength are null, because they need to know who the teacher is. sessionDuration and talkTimeBySpeaker are still returned, with role: null for every speaker.
  • No timestamps at all: every time field is null. Show "not available" rather than falling back to words.

Timeline (talkMoments) fields

Field Unit
duration (new) Always seconds, or null without timestamps
wordCount Always words
timestamp [start, end] in seconds
unitMeasure / aggregateUnitMeasure Existing behavior, unchanged: seconds (duration / end time) when every utterance has timestamps, word counts (count / running total) otherwise

For new work, use duration and wordCount so the unit is always clear.

Unchanged fields

talkDistribution and talkLength are still based on word counts, exactly as before.

Notes

  • One teacher per session. Only one speaker (uptake_speaker) can be the teacher. Support for multiple teachers would be a separate implementation.
  • Unknown speaker. unknown rows ([crosstalk] placeholders) are left out of talkTimeDistribution, talkTimeTotal and talkTimeLength. They are listed in talkTimeBySpeaker. The word-based fields still count them as student talk, as before.
  • Duplicate rows. Exact duplicates (same speaker, times and text) count once in the time fields. Untimed utterances are never treated as duplicates, since repeated short turns like "Yeah." are common. Other measures are unaffected.
  • Overlapping speech. When two people talk at the same time, each is credited with the overlap.
  • Speaker-ID confidence. Reported as avgConfidence but not used to filter. Student confidence is often low. Per-student numbers are approximate.
  • Rounding. New fields are rounded to 2 decimals. unitMeasure / aggregateUnitMeasure are not rounded.
  • Fixes. The handler no longer crashes when uptake_speaker is missing; before this change, a request without it failed entirely. The word-based talkDistribution / talkLength still need a teacher and are null without one. String timestamps (e.g. "151.283") are now converted to numbers instead of raising an error.
paiheng changed pull request status to open
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment