PROGRAMMING:Count the value of TF-IDF
TF-IDF (term frequency inverse document frequency) is a statistical method in natural language processing, which is used to evaluate the importance of a word to a document set or a document in a corpus. Term frequency (TF) refers to the number of times a given word appears in the file. The calculation method is as follows:
![ 360 screenshot 2018070408454340343. JPG] (~ / 84ca5791-a80a-4816-9400-93753ce2b349. JPG)
The main idea of IDF (inverse document frequency) is: if there are fewer documents containing entry T, the larger the IDF is, then the entry has a good ability to distinguish categories. The calculation method is as follows:
![ 360 screenshot 20180704084602918. JPG] (~ / 1f8fe0df-918d-4a34-9bcc-e7f30253373c. JPG)
The calculation formula of TF-IDF algorithm is as follows: TF-IDF = TF * IDF
The higher the TF-IDF value, the higher the probability of the word becoming a keyword.
Programming to achieve the calculation of TF-IDF program.
###Input format:
Each data is separated by a space, and four data are required to be input.
###Output format:
Three decimal places are reserved for each data.
###Input example:
Here is a set of inputs. For example:
```in
20 1000 25000000000 6230000000
```
###Output example:
The corresponding output is given here. For example:
```out
TF=0.020,IDF=0.603,TF_ IDF=0.012
```
answer:If there is no answer, please comment
![ 360 screenshot 2018070408454340343. JPG] (~ / 84ca5791-a80a-4816-9400-93753ce2b349. JPG)
The main idea of IDF (inverse document frequency) is: if there are fewer documents containing entry T, the larger the IDF is, then the entry has a good ability to distinguish categories. The calculation method is as follows:
![ 360 screenshot 20180704084602918. JPG] (~ / 1f8fe0df-918d-4a34-9bcc-e7f30253373c. JPG)
The calculation formula of TF-IDF algorithm is as follows: TF-IDF = TF * IDF
The higher the TF-IDF value, the higher the probability of the word becoming a keyword.
Programming to achieve the calculation of TF-IDF program.
###Input format:
Each data is separated by a space, and four data are required to be input.
###Output format:
Three decimal places are reserved for each data.
###Input example:
Here is a set of inputs. For example:
```in
20 1000 25000000000 6230000000
```
###Output example:
The corresponding output is given here. For example:
```out
TF=0.020,IDF=0.603,TF_ IDF=0.012
```
answer:If there is no answer, please comment