def filter_docs(docs, dic):
    """
    Helper function for filtering documents if the word occurs in the dictionary
    :param docs: list of list of int, the tokenized corpus
    :param dic: list of int, the dictionary
    :return: list of list of int, the content reduced corpus to the words in the dictionary
    """
    for i, _ in enumerate(docs):
        docs[i] = [word for word in docs[i] if word in dic]
    return docs