def calculate_wer(df):
    """ Calculates the word error rate and adds the collumn 'product' to the dataframe
    Args:
        df: a Pandas Dataframe to calculate used to calculate the wer
    Returns:
        df: The pandas dataframe with the column: 'product' (the product of the word error rate and the amount of ref words
        wer: The word error rate

    >>> DUMMY_DF = pandas.DataFrame({'wer':[0.2,0.4,0.1],'ref_words':[10,2,5]})
    >>> calculate_wer(DUMMY_DF)
    (   wer  ref_words  product
    0  0.2         10      2.0
    1  0.4          2      0.8
    2  0.1          5      0.5, 0.1941176470588235)

    """
    df['product'] = df['wer'] * df['ref_words']
    wer = float(df['product'].sum()) / float(df['ref_words'].sum())
    return df, wer