# Optimization of Associative Knowledge Graph Using TF-IDF Based Ranking Score
## 2 Related Work
### Word Classification Using Term Frequency-Inverse Document Frequency  
TF-IDF (Term Frequency-Inverse Document Frequency) is a method of calculating weights of terms in information search and text mining [23; 24]. It is used to judge how important a term is in a document. Formula (1) presents TF-IDF:  
\[TF-IDF(t,\ d,\ D)=tf(t,\ d)*idf(t,\ D) \tag{1}\]  
TF that stands for term frequency represents the frequency of the particular term \(t\) in a document. In short, it means how many times a particular term appears in one document. A _TF_ value has infinite divergence with the rise in the frequency of a particular word. _IDF_ (Inverse Document Frequency) means the inverse value of the word that appears commonly in multiple documents. Formula (2) presents _DF_ (Document Frequency). In Formula (2), \(t\) means the number of documents that include the term \(t\), and \(D\) means the total number of documents. _DF_ represents the frequency of a particular term in documents, so that \(t\) is divided by \(D\):  
\[DF(t,\ D)=\frac{t(n)}{D(n)} \tag{2}\]  
The reason why a _DF_ value is calculated is that if the number of documents that include a particular term increases among all documents, it means the word lacks discrimination. To lower weights of the frequently found words ('a', 'an', 'the', etc. ), it is necessary to calculate the value of _DF_. The higher the value of _DF_ is, the total result value has to be lower, thus, lower the weights of uninformative words. Accordingly, the inverse value of _DF_ is calculated, which is represented as _IDF_. Nevertheless, since a value of _IDF_ is used, it tends to increase exponentially unless a particular term appears. For example, if the term t appears nothing in ten documents, the df value is 10/0, which is an infinite value. To solve the problem, it is necessary to apply the logarithm of the inverse value of _DF_. Formula (3) is used to calculate the logarithm of _IDF_:  
\[IDF(t,\ D)=\log\left(\frac{D(n)}{t(n)}\right) \tag{3}\]  
A value of TF-IDF is calculated in the way of multiplying a value of TF which is the frequency of the term \(t\) in a particular document, by a value of _IDF_, the inverse value of the frequency of the term \(t\) in all documents. As a result, a TF-IDF value is large if the frequency of a particular term in a particular document is high and the number of documents that contain that particular term in all documents is low. In this way, it is possible to decrease the weights of words that contains in most documents and to increase the weights of the term with high importance in a particular document. As a result, important words are selected [25; 26]. [PERSON] [23] proposed the TF-IDF weighing method to determine the effective ranking, which utilizes frequency and normalization to find keywords in a document. The proposed method adaptively applies the combination of weights of components according to the length of a query. The longer the query length is, the more the method is effective, and the more it extracts significant and consistent words. [PERSON] et al. [24] proposed the text classification method using TF-IDF. It utilizes confidence and support in order to improve the recall and precision of document classification. It can solve the problem that a document duplicates in various categories and find a proper category. From the news stream data offered by MBC (Munhwa Broadcasting Corporation, South Korea), 1700 text data related to traffic accident topics [19] were collected and are converted into a corpus. Figure 3 shows the weights of the words calculated with the use of TF-IDF in the news stream data. Based on the calculated TF-IDF weights of the words in each collected documents, the weights of words in all documents are totaled. Terms are sorted in descending order of weight, and therefore a TF-IDF Rank Table is generated. Words are visualized in the graph in order of score. The x-axis means the words extracted from traffic accident topic text, and the y-axis means the TF-IDF weights.