def get_MLUw(sents, words_to_ignore=None):
    """Mean length of utterance (MLU) in words"""
    total_utterance_count = 0
    total_word_count = 0
    for sent in sents:
        total_utterance_count += 1
        for word in sent:
            if words_to_ignore and word in words_to_ignore:
                continue
            total_word_count += 1
    if total_utterance_count:
        return total_word_count / total_utterance_count
    else:
        return 0
