def wordlist_frac(utt, history, word_list):
    """
    Sentence-level attribute function. See explanation above.
    Returns the fraction of words in utt that are in word_list.
    Additional inputs:
      word_list: list of strings.
    """
    words = utt.split()
    num_in_list = len([w for w in words if w in word_list])
    return num_in_list / len(words)