utils4text.py
def count_listener_profanity(df):
    """
    Compute the number of profane words spoken by the listeners.

    Arg:
        df: A dataframe containing profane utterances.
    Return:
        len(df_listener_toxic): the length of the dataframe of profanity from listeners.
    """
    # extract listeners' turn
    df_listener = df[df['dialog turn'] != 1]

    # extract toxic turn
    df_listener_toxic = apply_parallel(df_listener.groupby(df_listener['conversation id']), extract_profanity)

    return len(df_listener_toxic)

    Compute the number of profane words spoken by the listeners.

    Arg:
        df: A dataframe containing profane utterances.
    Return:
        len(df_listener_toxic): the length of the dataframe of profanity from listeners.
    
Compute the number of profane words spoken by the listeners.
Arg:
df: A dataframe containing profane utterances.
Return:
len(df_listener_toxic): the length of the dataframe of profanity from listeners.
Compute the number of profane words spoken by the listeners . Arg : df : A dataframe containing profane utterances . Return : len ( df_listener_toxic ) : the length of the dataframe of profanity from listeners .
def count_listener_profanity(df):
    df_listener = df[df['dialog turn'] != 1]
    df_listener_toxic = apply_parallel(df_listener.groupby(df_listener['conversation id']), extract_profanity)
    return len(df_listener_toxic)
def count_listener_profanity ( df ) : df_listener = df [ df [ 'dialog turn' ] != 1 ] df_listener_toxic = apply_parallel ( df_listener . groupby ( df_listener [ 'conversation id' ] ) , extract_profanity ) return len ( df_listener_toxic )
Compute the number of profane words spoken by the listeners.
Compute the number of profane words spoken by the listeners .
"""
    Compute the number of profane words spoken by the listeners.

    Arg:
        df: A dataframe containing profane utterances.
    Return:
        len(df_listener_toxic): the length of the dataframe of profanity from listeners.
    """ # extract listeners' turn # extract toxic turn
df