Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NGram ¶
NGram returns UTF-8 character n-grams created from the given text. This function assumes that s only contains valid UTF-8 letters. It returns an empty array when n isn't greater than 0.
func RemoveEmptyWord ¶
RemoveEmptyWord removes an empty string from an array of strings.
func WeightBinary ¶
WeightBinary creates a map having weights of each word. The weight is 1 if there's at least one word, or 0 otherwise. Because feature vectors created by this function is sparse, all values in resulting maps are 1. In other words, instead of having 0 as a value, a key doesn't exist for a word that is not in the given array.
func WeightLogTF ¶
WeightLogTF creates a map having a word as a key and its log(1 + tf) as a value. This function is useful when some words appear too much but binary weight isn't sufficient.
Types ¶
This section is empty.