get_user_network module
- features.get_user_network.get_user_network(user_df, conversation_id_col, speaker_id_col)
Takes in data at the user level, and generates a “user_list” per user per conversation. This “user_list” contains the other participating in this conversation. This is a user level feature.
- Parameters:
user_df (pd.DataFrame) – The dataset for which we are generating a “user_list” per user per conversation.
conversation_id_col (str) – The name of the column containing conversation identifiers.
speaker_id_col (str) – The name of the column containing the speaker’s unique identifier.
- Returns:
Updated user_df with a ‘user_list’ column
- Return type:
pd.DataFrame
- features.get_user_network.remove_active_user(df, speaker_id_col)
Removes the active user from their own ‘user_list’ in each row of the DataFrame.
- Parameters:
df (pd.DataFrame) – Contains ‘speaker_nickname’ and ‘user_list’ columns.
speaker_id_col (str) – The name of the column containing the speaker’s unique identifier.
- Returns:
Modified pd.DataFrame with ‘user_list’ updated to remove the active user.
- Return type:
pd.DataFrame