[{"name":"Documents","comment":" \n\n#Sample Documents\n\n@docs documents\n\n","unions":[],"aliases":[],"values":[{"name":"documents","comment":"\nThe `documents` module contains a list of documents, where each document is represented \nas a list of words (fruits in this case). This structure can be utilized for various \ntext processing tasks, such as calculating term frequency-inverse document frequency (TF-IDF).\n\nEach document showcases a mixture of fruit names to provide a diverse vocabulary for analysis.\n","type":"List.List (List.List String.String)"}],"binops":[]},{"name":"TfIdf","comment":" \n\n#Term Frequency TF\n\n@docs tf\n\n#Inverse Document Frequency IDF\n\n@docs idf\n\n#Calculate the TF-IDF score for a given term in a specific document \n\n@docs tfidf\n\n#Calculate the TF-IDF score for a term across all documents.\n\n@docs calculateTfidfForTerm\n\n","unions":[],"aliases":[],"values":[{"name":"calculateTfidfForTerm","comment":" \n    Calculate the TF-IDF score for a term across all documents.\n    \n    This function applies the TF-IDF calculation to each document in the \n    provided list of documents.\n    \n    ## Parameters\n    - `term`: The term for which the TF-IDF scores are to be calculated.\n    - `docs`: A list of documents, where each document is represented as a list of terms.\n    \n    ## Returns\n    A list of floats representing the TF-IDF scores for the term in each document.\n","type":"String.String -> List.List (List.List String.String) -> List.List Basics.Float"},{"name":"idf","comment":" \n    Calculate Inverse Document Frequency (IDF) for a given term across multiple documents.\n    \n    The inverse document frequency measures how important a term is by \n    determining how many documents contain the term.\n    \n    ## Parameters\n    - `term`: The term for which the IDF is to be calculated.\n    - `documents`: A list of documents, where each document is represented as a list of terms.\n    \n    ## Returns\n    A float representing the inverse document frequency (IDF) of the term.\n","type":"String.String -> List.List (List.List String.String) -> Basics.Float"},{"name":"tf","comment":" \n    Calculate Term Frequency (TF) for a given term in a document.\n    \n    The term frequency is the number of times a term appears in a document \n    divided by the total number of terms in that document.\n    \n    ## Parameters\n    - `term`: The term for which the frequency is to be calculated.\n    - `document`: The list of terms (words) in the document.\n    \n    ## Returns\n    A float representing the term frequency (TF) of the term in the document.\n","type":"String.String -> List.List String.String -> Basics.Float"},{"name":"tfidf","comment":" \n    Calculate the TF-IDF score for a given term in a specific document \n    based on the set of documents.\n    \n    The TF-IDF score is a measure of how relevant a term is to a document \n    within a collection of documents.\n    \n    ## Parameters\n    - `term`: The term for which the TF-IDF score is to be calculated.\n    - `document`: The list of terms (words) in the document.\n    - `documents`: A list of documents to compute the IDF.\n    \n    ## Returns\n    A float representing the TF-IDF score of the term in the document.\n","type":"String.String -> List.List String.String -> List.List (List.List String.String) -> Basics.Float"}],"binops":[]}]