Documentation
¶
Overview ¶
Package tfidf Provides a simple implementation of Term-Frequency Inverse-Document-Frequency in golang Can return the points in tf values or tf-idf values
Index ¶
- type FloatMap
- type TF_IDF
- func (tf_idf *TF_IDF) AddToWordSet(corpus []WordSet)
- func (tf_idf *TF_IDF) ComputeIDF()
- func (tf_idf *TF_IDF) ComputeTF(corpus WordSet)
- func (tf_idf *TF_IDF) ComputeTFIDF()
- func (tf_idf *TF_IDF) GetAllPointsTF() []kmeans.Point
- func (tf_idf *TF_IDF) GetAllPointsTFIDF() []kmeans.Point
- func (tf_idf *TF_IDF) GetComputedIDF(countMap WordCounts) FloatMap
- func (tf_idf *TF_IDF) GetComputedTF(corpus WordSet, counts WordCounts) FloatMap
- func (tf_idf *TF_IDF) GetComputedTFIDF(tf FloatMap, idf FloatMap) FloatMap
- func (tf_idf *TF_IDF) GetIDF() FloatMap
- func (tf_idf *TF_IDF) GetPointByIndexTF(idx int) kmeans.Point
- func (tf_idf *TF_IDF) GetPointByIndexTFIDF(idx int) kmeans.Point
- func (tf_idf *TF_IDF) GetSetCount(corpus WordSet) WordCounts
- func (tf_idf *TF_IDF) SetCount(corpus WordSet)
- func (tf_idf *TF_IDF) SetCountIdx(corpus WordSet, idx int)
- func (tf_idf *TF_IDF) SortMap()
- type WordCounts
- type WordSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TF_IDF ¶
type TF_IDF struct {
//List of words
SetWord WordSet
//Count of each word by set
WordCountList []WordCounts
//Term-Frequency
Tf []FloatMap
//Inverse Document Frequency
Idf FloatMap
//Term-Frequency Inverse Document Frequency
TfIdf []FloatMap
}
TF_IDF - Struct for calculation TF-IDF
func (*TF_IDF) AddToWordSet ¶ added in v0.1.2
AddToWordSet - adds the set to the list of sets
func (*TF_IDF) ComputeIDF ¶
func (tf_idf *TF_IDF) ComputeIDF()
ComputeIDF - computes the inverse document frequency for the list of sets
func (*TF_IDF) ComputeTFIDF ¶ added in v0.1.4
func (tf_idf *TF_IDF) ComputeTFIDF()
ComputeTFIDF - computes the tf-idf for the each set of words
func (*TF_IDF) GetAllPointsTF ¶ added in v0.1.3
GetAllPointsTF - gets all the points in the list
func (*TF_IDF) GetAllPointsTFIDF ¶
GetAllPointsTFIDF - gets all the points in the list
func (*TF_IDF) GetComputedIDF ¶ added in v0.1.10
func (tf_idf *TF_IDF) GetComputedIDF(countMap WordCounts) FloatMap
GetComputedIDF - computes the inverse document frequency for the list of sets
func (*TF_IDF) GetComputedTF ¶ added in v0.1.9
func (tf_idf *TF_IDF) GetComputedTF(corpus WordSet, counts WordCounts) FloatMap
GetComputedTF - computes the term frequency for the word set
func (*TF_IDF) GetComputedTFIDF ¶ added in v0.1.10
GetComputedTFIDF - computes the tf-idf for the each set of words
func (*TF_IDF) GetPointByIndexTF ¶
GetPointByIndexTF - gets tf map of the point in the indes
func (*TF_IDF) GetPointByIndexTFIDF ¶
GetPointByIndexTFIDF - gets tfIdf map of the point in the index
func (*TF_IDF) GetSetCount ¶ added in v0.1.8
func (tf_idf *TF_IDF) GetSetCount(corpus WordSet) WordCounts
GetSetCount - returns count of words for corresponding set
func (*TF_IDF) SetCountIdx ¶ added in v0.1.5
SetCountIdx - sets the counts of words for the set in that idx
type WordCounts ¶
WordCounts - Dictionary of word by count
func InitCounts ¶
func InitCounts(set WordSet) WordCounts
InitCounts - returns a map of WordCounts with the set of words