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) GetAllPointsTFIDF() []kmeans.Point
- 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) SetCount(corpus WordSet)
- 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) GetAllPointsTFIDF ¶
GetAllPointsTFIDF - gets all the points in the list
func (*TF_IDF) GetPointByIndexTF ¶
GetPointByIndexTF - gets tf map of the point in the indes
func (*TF_IDF) GetPointByIndexTFIDF ¶
GetPointByIndexTFIDF - gets tf map of the point in the indes
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
Click to show internal directories.
Click to hide internal directories.