def _create_tf_idf_matrix(tf_matrix: dict, idf_matrix: dict) -> dict:
    """
    Returns a tf-idf matrix for the given frequency matrix.
    :param tf_matrix: The term frequency matrix to be summarized.
    :param idf_matrix: The inverse document frequency matrix.
    :return: A tf-idf matrix for the given frequency matrix.
    """
    tf_idf_matrix = dict()

    for (sentence1, tf_table1), (sentence2,
                                 tf_table2) in zip(tf_matrix.items(),
                                                   idf_matrix.items()):
        tf_idf_table = dict()
        for (word1, value1), (word2, value2) in zip(tf_table1.items(),
                                                    tf_table2.items()):
            tf_idf_table[word1] = float(value1 * value2)
        tf_idf_matrix[sentence1] = tf_idf_table
    return tf_idf_matrix