Documentation ¶
Overview ¶
Package jtfidf provides calculations of TF(Term Frequency), IDF(Inverse Document Frequency) and TF-IDF values at Japanese documents.
Dependencies ¶
This package uses [kagome](https://github.com/ikawaha/kagome) as Morphological Analyzer.
About how to calulate TF-IDF value ¶
The calculation of the TF-IDF value in this package uses the IDF value plus 1. This is to prevent the TF-IDF value from becoming 0.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllIdf ¶
AllIdf returns all IDF values in ds
Example ¶
ds := []string{ "寿司が食べたい。", } fmt.Println(AllIdf(ds))
Output: map[。:0 が:0 たい:0 寿司:0 食べ:0]
func AllTf ¶
AllTf returns all TF values in d
Example ¶
fmt.Println(AllTf("寿司が食べたい。"))
Output: map[。:0.2 が:0.2 たい:0.2 寿司:0.2 食べ:0.2]
func AllTfidf ¶
AllTfidf retuns all TF-IDF values in ds
Example ¶
ds := []string{ "寿司が食べたい。", } fmt.Println(AllTfidf(ds))
Output: [map[。:0.2 が:0.2 たい:0.2 寿司:0.2 食べ:0.2]]
func Idf ¶
Idf retuns t's IDF value in ds
Example ¶
ds := []string{ "寿司が食べたい。", } fmt.Println(Idf("寿司", ds))
Output: 0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.