TF-IDF (Fréquence du terme - Fréquence inverse du document)
TF-IDF is a statistical measure that assesses the importance of a word within a document relative to a set of documents, often referred to as a corpus. It is widely used in la récupération d'informations, traitement du langage naturel, and extraction de texte.
La mesure comprend deux composantes : la fréquence du terme (TF) et Fréquence de Document Inverse (IDF). Term Frequency calculates how frequently a term appears in a specific document. The intuition is that the more times a word appears in a document, the more relevant it is to the content of that document. Mathematically, it is expressed as:
TF(t, d) = (Nombre de fois que le terme t apparaît dans le document d) / (Nombre total de termes dans le document d)
On the other hand, Inverse Document Frequency quantifies how much information a word provides, based on how common or rare it is across all documents. Words that are very common across many documents (like ‘the’ or ‘and’) are less informative. IDF is calculated as:
IDF(t, D) = log(Nombre total de documents dans D / Nombre de documents contenant le terme t)
En combinant ces deux composantes, le score TF-IDF est calculé comme :
TF-IDF(t, d, D) = TF(t, d) * IDF(t, D)
This score helps highlight keywords that are both relevant to a specific document and not overly common in the broader corpus, thus making it a powerful tool for text analysis, search engines, and systèmes de recommandation. For example, documents that contain a high TF-IDF score for a particular term are likely to be more relevant to queries involving that term.