utils4text.py
def listener_emotion_count(df_convs):
    """
    Compute the number of emotion prediction.

    Arg:
        df_convs: A conversation dataframe with predicted emotion labels.
    Return:
        df_listener_emotion_count: A dataframe summarizing predicted emotion counting. 
    """
    if len(df_convs['dialog turn']) >= 1:
        speaker = df_convs[df_convs['dialog turn'] == 1].author.values[0]
        df_convs_listener = df_convs[df_convs['author'] != speaker]
        df_listener_emotion_count = pd.DataFrame(df_convs_listener['emotion prediction'].value_counts())\
                                        .reset_index()\
                                        .rename(columns = {'index': 'emotion', 'emotion prediction': 'count'})

        return df_listener_emotion_count
    else:
        return None

    Compute the number of emotion prediction.

    Arg:
        df_convs: A conversation dataframe with predicted emotion labels.
    Return:
        df_listener_emotion_count: A dataframe summarizing predicted emotion counting. 
    
Compute the number of emotion prediction.
Arg:
df_convs: A conversation dataframe with predicted emotion labels.
Return:
df_listener_emotion_count: A dataframe summarizing predicted emotion counting.
Compute the number of emotion prediction . Arg : df_convs : A conversation dataframe with predicted emotion labels . Return : df_listener_emotion_count : A dataframe summarizing predicted emotion counting .
def listener_emotion_count(df_convs):
    if len(df_convs['dialog turn']) >= 1:
        speaker = df_convs[df_convs['dialog turn'] == 1].author.values[0]
        df_convs_listener = df_convs[df_convs['author'] != speaker]
        df_listener_emotion_count = pd.DataFrame(df_convs_listener['emotion prediction'].value_counts())\
                                        .reset_index()\
                                        .rename(columns = {'index': 'emotion', 'emotion prediction': 'count'})
        return df_listener_emotion_count
    else:
        return None
def listener_emotion_count ( df_convs ) : if len ( df_convs [ 'dialog turn' ] ) >= 1 : speaker = df_convs [ df_convs [ 'dialog turn' ] == 1 ] . author . values [ 0 ] df_convs_listener = df_convs [ df_convs [ 'author' ] != speaker ] df_listener_emotion_count = pd . DataFrame ( df_convs_listener [ 'emotion prediction' ] . value_counts ( ) ) . reset_index ( ) . rename ( columns = { 'index' : 'emotion' , 'emotion prediction' : 'count' } ) return df_listener_emotion_count else : return None
Compute the number of emotion prediction.
Compute the number of emotion prediction .
"""
    Compute the number of emotion prediction.

    Arg:
        df_convs: A conversation dataframe with predicted emotion labels.
    Return:
        df_listener_emotion_count: A dataframe summarizing predicted emotion counting. 
    """
df_convs