turn_taking_features module

features.turn_taking_features.count_turn_taking_index(input_data, speaker_id_col)

Returns the turn-taking index for each speaker.

Parameters:
  • input_data (pd.DataFrame) – A dataframe of conversations, in which each row is one chat.

  • speaker_id_col (str) – The name of the column containing the speaker’s unique identifier.

Returns:

The turn-taking index for the speaker.

Return type:

float

features.turn_taking_features.count_turns(input_data, speaker_id_col)

Returns the total number of turns for each speaker.

Parameters:
  • input_data (pd.DataFrame) – A dataframe of conversations, in which each row is one chat.

  • speaker_id_col (str) – The name of the column containing the speaker’s unique identifier.

Returns:

A dataframe with columns for the speaker’s unique identifier and their turn count.

Return type:

pd.DataFrame

features.turn_taking_features.get_turn(input_data, conversation_id_col, speaker_id_col)

Returns the turn-taking index for each conversation.

Parameters:
  • input_data (pd.DataFrame) – A dataframe of conversations, in which each row is one chat.

  • conversation_id_col (str) – The name of the column containing the conversation’s unique identifier.

  • speaker_id_col (str) – The name of the column containing the speaker’s unique identifier.

Returns:

A dataframe with columns for the conversation’s unique identifier and the turn-taking index.

Return type:

pd.DataFrame