def get_word_count_lst(text, unigram_prob_dict_truthful, unigram_prob_dict_deceptive):
    """
    Produces a list, where each unique word in the unigram dictionaries is assigned to an
    index, and the value at the index is the number of times that unigram appears in the text.
    Words in the text that do not appear in the unigram dictionaries are ignored.

    Args:
        text: string containing text to find the perplexity of
        unigram_prob_dict_truthful: a dictionary mapping unigrams found in truthful reviews
        to their respective probabilities
        unigram_prob_dict_deceptive: a dictionary mapping unigrams found in deceptive reviews
        to their respective probabilities

    Returns:
        A list representing the occurences of the words in the text (only words that appear
        in the unigram dictionaries are captured)
    """
    training_keys_trutuful = list(unigram_prob_dict_truthful.keys())
    training_keys_deceptive = list(unigram_prob_dict_deceptive.keys())
    all_training_keys = sorted(
        training_keys_trutuful
        + list(set(training_keys_deceptive) - set(training_keys_trutuful))
    )

    word_count_lst = [0] * len(all_training_keys)
    text_lst = text.split(" ")
    for word in text_lst:
        try:
            idx = all_training_keys.index(word)  # unseen word will not be found
            word_count_lst[idx] = word_count_lst[idx] + 1
        except:
            pass

    return word_count_lst