#Term Frequency TF
#Inverse Document Frequency IDF
Calculate Inverse Document Frequency (IDF) for a given term across multiple documents.
The inverse document frequency measures how important a term is by
determining how many documents contain the term.
## Parameters
- `term`: The term for which the IDF is to be calculated.
- `documents`: A list of documents, where each document is represented as a list of terms.
## Returns
A float representing the inverse document frequency (IDF) of the term.#Calculate the TF-IDF score for a given term in a specific document
Calculate the TF-IDF score for a given term in a specific document
based on the set of documents.
The TF-IDF score is a measure of how relevant a term is to a document
within a collection of documents.
## Parameters
- `term`: The term for which the TF-IDF score is to be calculated.
- `document`: The list of terms (words) in the document.
- `documents`: A list of documents to compute the IDF.
## Returns
A float representing the TF-IDF score of the term in the document.#Calculate the TF-IDF score for a term across all documents.
Calculate the TF-IDF score for a term across all documents.
This function applies the TF-IDF calculation to each document in the
provided list of documents.
## Parameters
- `term`: The term for which the TF-IDF scores are to be calculated.
- `docs`: A list of documents, where each document is represented as a list of terms.
## Returns
A list of floats representing the TF-IDF scores for the term in each document.