def compute_propability(word, label, dict):
    """
    Computes probability q(word | label).
    :param word: a word/state y_i
    :param label: a label/state y_i-1
    :param dict: dictionary where pre-computed values are stored
    :return: dict(y_i | y_i-1)
    """
    return dict[label][word] / sum(dict[label].values())