Class Vocabulary
java.lang.Object
ai.beestream.jitnn.nn.text.Vocabulary
Word ids by descending frequency, the words seen at least
minCount times.-
Method Summary
Modifier and TypeMethodDescriptionstatic VocabularyThe vocabulary of the words insentencesseen at leastminCounttimes.long[]counts()Each word's count, indexed by id.List<int[]> Each sentence as ids, words outside the vocabulary dropped.intThe id ofword, or -1 when it is not in the vocabulary.intsize()The number of words.word(int id) The word with idid.
-
Method Details
-
build
The vocabulary of the words insentencesseen at leastminCounttimes. -
size
public int size()The number of words. -
id
The id ofword, or -1 when it is not in the vocabulary. -
word
The word with idid. -
counts
public long[] counts()Each word's count, indexed by id. -
encode
-