Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update doc
  • Loading branch information
seanzhangkx8 authored Oct 11, 2025
commit 7376c0635c6fb257c78eddacd58a84dd28e5f7c7
10 changes: 6 additions & 4 deletions convokit/talktimesharing/talktimesharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class TalkTimeSharing(Transformer):

It assigns each conversation a primary speaker group (more talkative), a secondary
speaker group (less talkative), and a scalar imbalance score. It also computes a
list of windowed imbalance scores over a sliding windows of the conversation.
list of windowed imbalance scores over a sliding windows of the conversation to capture how talk-time
sharing distribution unfolds over time.

Each utterance is expected to have a speaker group label under `utt.meta['utt_group']`,
which can be precomputed or inferred from `convo.meta['speaker_groups']`.
Expand Down Expand Up @@ -114,10 +115,11 @@ def transform(
self, corpus: Corpus, selector: Callable[[Conversation], bool] = lambda convo: True
):
"""
Computes talk-time balance metrics for each conversation in the corpus.
Computes and annotate talk-time sharing information for each conversation in the corpus.

Annotates the corpus with speaker group labels and if utterances `utt_group` metadata is missing, the data
is assumed to be labeled in `convo.meta['speaker_groups']`.

Each conversation is then annotated with its primary and secondary speaker groups, an overall conversation level
imbalance score, and a list of windowed imbalance score computed via sliding window analysis.

Expand All @@ -141,8 +143,8 @@ def transform(
for utt in convo.iter_utterances():
utt.meta["utt_group"] = speaker_groups_dict[utt.speaker.id]

### Annotate conversations with Balance information
for convo in tqdm(corpus.iter_conversations(), desc="Annotating conversation balance"):
### Annotate conversations with talk-time sharing information
for convo in tqdm(corpus.iter_conversations(), desc="Annotating conversation talk-time sharing"):
if selector(convo):
convo.meta["primary_speaker"] = _get_ps(
corpus,
Expand Down
Loading