def _score_sentences(tf_idf_matrix: dict) -> dict:
    """
    Finds the score of each sentence in the text based on the tf-idf values.
    :param tf_idf_matrix: The term frequency-inverse document frequency matrix.
    :return: The score of each sentence in the text.
    """
    sentenceValue = dict()

    for sentence, freq_table in tf_idf_matrix.items():
        score = 0
        count_words_in_sentence = len(freq_table)
        for word, value in freq_table.items():
            score += value
        if count_words_in_sentence > 0:
            sentenceValue[sentence] = score / count_words_in_sentence
    return sentenceValue