MCPcopy Create free account

hub / github.com/AlexWan0/infini-gram / functions

Functions139 in github.com/AlexWan0/infini-gram

↓ 8 callersMethodlen
()
suffixarray/suffixarray.go:47
↓ 6 callersMethodWrite
Write writes the index x to w.
suffixarray/suffixarray.go:204
↓ 5 callersMethodget
(index int64)
sa_map.go:12
↓ 4 callersMethodRead
reasonable for BenchmarkSaveRestore Read reads the index from r into x; x must not be nil.
suffixarray/suffixarray.go:154
↓ 4 callersFunctionbucketMax_32
(text []int32, freq, bucket []int32)
suffixarray/sais2.go:302
↓ 4 callersFunctionbucketMax_64
(text []int64, freq, bucket []int64)
suffixarray/sais2.go:311
↓ 4 callersFunctionbucketMax_8_32
bucketMax_8_32 stores into bucket[c] the maximum index in the bucket for character c in a bucket-sort of text. The bucket indexes for c are [min, max)
suffixarray/sais.go:255
↓ 4 callersFunctionbucketMax_8_64
(text []byte, freq, bucket []int64)
suffixarray/sais2.go:291
↓ 4 callersMethodslice
(i, j int)
suffixarray/suffixarray.go:66
↓ 3 callersMethodNextTokenDistribution
Will return the prediction of the next token distribution corresponding to the longest suffix in queryIds. For a suffix to be considered valid, there
infinigram.go:34
↓ 3 callersMethodgetSlice
(start int64, stop int64)
data_map.go:11
↓ 3 callersMethodlength
()
data_map.go:12
↓ 3 callersFunctionputByte
Puts the value into the byte slice at the given index.
utils.go:11
↓ 2 callersMethodLookup
Lookup returns an unsorted list of at most n indices where the byte string s occurs in the indexed data. If n < 0, all occurrences are returned. The r
suffixarray/suffixarray.go:256
↓ 2 callersFunctionargmax
(vec []float32)
utils.go:103
↓ 2 callersFunctionarraySearch
Search for the occurrences of a query in the suffix array. Returns the starting and ending positions of the occurrences.
suffixarray_utils.go:106
↓ 2 callersMethodat
(i int)
suffixarray/suffixarray.go:236
↓ 2 callersFunctionbinarySearch
Perform left or right binary search on the suffix array.
suffixarray_utils.go:75
↓ 2 callersFunctionbucketMin_32
(text []int32, freq, bucket []int32)
suffixarray/sais2.go:273
↓ 2 callersFunctionbucketMin_64
(text []int64, freq, bucket []int64)
suffixarray/sais2.go:282
↓ 2 callersFunctionbucketMin_8_32
bucketMin_8_32 stores into bucket[c] the minimum index in the bucket for character c in a bucket-sort of text.
suffixarray/sais.go:240
↓ 2 callersFunctionbucketMin_8_64
(text []byte, freq, bucket []int64)
suffixarray/sais2.go:262
↓ 2 callersFunctioncompareSlices
Compare whether a is before b lexographically. Returns -1 if a < b, 0 if a == b, and 1 if a > b.
utils.go:70
↓ 2 callersFunctionfreq_32
(text []int32, freq, bucket []int32)
suffixarray/sais2.go:228
↓ 2 callersFunctionfreq_64
(text []int64, freq, bucket []int64)
suffixarray/sais2.go:245
↓ 2 callersFunctionfreq_8_32
freq_8_32 returns the character frequencies for text, as a slice indexed by character value. If freq is nil, freq_8_32 uses and returns bucket. If fre
suffixarray/sais.go:220
↓ 2 callersFunctionfreq_8_64
(text []byte, freq, bucket []int64)
suffixarray/sais2.go:210
↓ 2 callersMethodgetArray
Retrieve the suffix array for a given index.
suffixarray_utils.go:39
↓ 2 callersFunctionintToByte
(vec []uint32)
utils.go:15
↓ 2 callersFunctionmakeMultiSuffixArray
Create a multi-suffix array from a list of suffix array paths.
suffixarray_utils.go:20
↓ 2 callersFunctionmap_32
map_32 maps the LMS-substrings in text to their new IDs, producing the subproblem for the recursion. The mapping itself was mostly applied by assignID
suffixarray/sais.go:647
↓ 2 callersFunctionmap_64
(sa []int64, numLMS int)
suffixarray/sais2.go:1190
↓ 2 callersMethodnumArrays
Retrieve the number of suffix arrays.
suffixarray_utils.go:34
↓ 2 callersFunctionreadBytesFromFile
(filename string)
files.go:61
↓ 2 callersFunctionreadDocuments
(filename, lineSplit string, callback func(*string) error)
files.go:143
↓ 2 callersFunctionreadInt
readInt reads an int x from r using buf to buffer the read and returns x.
suffixarray/suffixarray.go:95
↓ 2 callersFunctionrecurse_32
recurse_32 calls sais_32 recursively to solve the subproblem we've built. The subproblem is at the right end of sa, the suffix array result will be wr
suffixarray/sais.go:662
↓ 2 callersFunctionrecurse_64
(sa, oldTmp []int64, numLMS, maxID int)
suffixarray/sais2.go:1201
↓ 2 callersFunctionsais_8_32
sais_8_32 computes the suffix array of text. The text must contain only values in [0, textMax). The suffix array is stored in sa, which the caller mus
suffixarray/sais.go:150
↓ 2 callersFunctionsais_8_64
(text []byte, textMax int, sa, tmp []int64)
suffixarray/sais2.go:24
↓ 1 callersMethodGenerateGreedyStream
Same as GenerateGreedy, but will send intermediate results to the generatedTokens
infinigram.go:123
↓ 1 callersFunctionInitializeModel
Creates the tokenized corpus and suffix array, saves them to outpath, and returns the model. If either the tokenized corpus or suffix array already ex
infinigram.go:150
↓ 1 callersFunctionInteractiveGenerateGreedy
Given a sequence of tokens (queryIds) will greedily generate numNewTokens tokens using the longest possible suffix. The suffix must have at least minM
infinigram.go:285
↓ 1 callersFunctionInteractiveNextToken
Given a sequence of tokens (queryIds) will print the top-k most likely continuations using the longest possible suffix. The suffix must have at least
infinigram.go:249
↓ 1 callersFunctionText_64
(text []byte, sa []int64)
suffixarray/sais2.go:9
↓ 1 callersFunctionargsort
(vec []float32, descending bool)
utils.go:87
↓ 1 callersFunctionassignID_32
(text []int32, sa []int32, numLMS int)
suffixarray/sais2.go:1118
↓ 1 callersFunctionassignID_64
(text []int64, sa []int64, numLMS int)
suffixarray/sais2.go:1154
↓ 1 callersFunctionassignID_8_32
assignID_8_32 assigns a dense ID numbering to the set of LMS-substrings respecting string ordering and equality, returning the maximum assigned ID. Fo
suffixarray/sais.go:600
↓ 1 callersFunctionassignID_8_64
(text []byte, sa []int64, numLMS int)
suffixarray/sais2.go:1082
↓ 1 callersFunctionbyteToInt
(vec []byte)
utils.go:45
↓ 1 callersFunctioncreateUnalignedSuffixArray
Create a suffix array for a given byte array. Each token is a uint16 value, so will take up two bytes. This means that only even indices in the suffix
suffixarray_utils.go:195
↓ 1 callersFunctiondocumentIter
Reads as many documents as possible (delineated by the sentinal) from filename into slice chunk. Will try to read as many documents as possible into c
files.go:186
↓ 1 callersFunctionencodeSequence
Encode a sequence of integers into a byte array ending in the sentinal. The sentinalVal is repeated sentinalSize times.
suffixarray_utils.go:179
↓ 1 callersFunctionexpand_32
(text []int32, freq, bucket, sa []int32, numLMS int)
suffixarray/sais2.go:1375
↓ 1 callersFunctionexpand_64
(text []int64, freq, bucket, sa []int64, numLMS int)
suffixarray/sais2.go:1406
↓ 1 callersFunctionexpand_8_32
expand_8_32 distributes the compacted, sorted LMS-suffix indexes from sa[:numLMS] into the tops of the appropriate buckets in sa, preserving the sorte
suffixarray/sais.go:764
↓ 1 callersFunctionexpand_8_64
(text []byte, freq, bucket, sa []int64, numLMS int)
suffixarray/sais2.go:1343
↓ 1 callersFunctionfindLastSentinal
(values []byte, length, sentinalSize, sentinalValue int)
files.go:277
↓ 1 callersFunctionhasSentinal
(values []byte, length, sentinalSize, sentinalValue int)
files.go:262
↓ 1 callersFunctioninduceL_32
(text []int32, sa, freq, bucket []int32)
suffixarray/sais2.go:1498
↓ 1 callersFunctioninduceL_64
(text []int64, sa, freq, bucket []int64)
suffixarray/sais2.go:1558
↓ 1 callersFunctioninduceL_8_32
induceL_8_32 inserts L-type text indexes into sa, assuming that the leftmost S-type indexes are inserted into sa, in sorted order, in the right bucket
suffixarray/sais.go:802
↓ 1 callersFunctioninduceL_8_64
(text []byte, sa, freq, bucket []int64)
suffixarray/sais2.go:1437
↓ 1 callersFunctioninduceS_32
(text []int32, sa, freq, bucket []int32)
suffixarray/sais2.go:1663
↓ 1 callersFunctioninduceS_64
(text []int64, sa, freq, bucket []int64)
suffixarray/sais2.go:1707
↓ 1 callersFunctioninduceS_8_32
(text []byte, sa, freq, bucket []int32)
suffixarray/sais.go:863
↓ 1 callersFunctioninduceS_8_64
(text []byte, sa, freq, bucket []int64)
suffixarray/sais2.go:1618
↓ 1 callersFunctioninduceSubL_32
(text []int32, sa, freq, bucket []int32)
suffixarray/sais2.go:594
↓ 1 callersFunctioninduceSubL_64
(text []int64, sa, freq, bucket []int64)
suffixarray/sais2.go:671
↓ 1 callersFunctioninduceSubL_8_32
induceSubL_8_32 inserts the L-type text indexes of LMS-substrings into sa, assuming that the final characters of the LMS-substrings are already insert
suffixarray/sais.go:364
↓ 1 callersFunctioninduceSubL_8_64
(text []byte, sa, freq, bucket []int64)
suffixarray/sais2.go:516
↓ 1 callersFunctioninduceSubS_32
(text []int32, sa, freq, bucket []int32)
suffixarray/sais2.go:812
↓ 1 callersFunctioninduceSubS_64
(text []int64, sa, freq, bucket []int64)
suffixarray/sais2.go:875
↓ 1 callersFunctioninduceSubS_8_32
induceSubS_8_32 inserts the S-type text indexes of LMS-substrings into sa, assuming that the leftmost L-type text indexes are already inserted into sa
suffixarray/sais.go:454
↓ 1 callersFunctioninduceSubS_8_64
(text []byte, sa, freq, bucket []int64)
suffixarray/sais2.go:748
↓ 1 callersFunctioninitTokenizer
(tokenizerConfig string)
tokenize.go:18
↓ 1 callersFunctionintToUint32
(vec []int)
utils.go:25
↓ 1 callersFunctionisAllWhitespace
(lineP *string)
tokenize.go:14
↓ 1 callersFunctionlength_32
(text []int32, sa []int32, numLMS int)
suffixarray/sais2.go:990
↓ 1 callersFunctionlength_64
(text []int64, sa []int64, numLMS int)
suffixarray/sais2.go:1036
↓ 1 callersFunctionlength_8_32
length_8_32 computes and records the length of each LMS-substring in text. The length of the LMS-substring at index j is stored at sa[j/2], avoiding t
suffixarray/sais.go:538
↓ 1 callersFunctionlength_8_64
(text []byte, sa []int64, numLMS int)
suffixarray/sais2.go:938
↓ 1 callersFunctionloadMMappedArray
(filepath string)
data_map.go:41
↓ 1 callersMethodlookupAll
lookupAll returns a slice into the matching region of the index. The runtime is O(log(N)*len(s)).
suffixarray/suffixarray.go:242
↓ 1 callersFunctionmakeFolder
(folderPath string)
files.go:100
↓ 1 callersFunctionmakeMMappedSA
(filepath string)
sa_map.go:76
↓ 1 callersFunctionnumLines
(filename string, lineBoundary string)
files.go:173
↓ 1 callersFunctionplaceLMS_32
(text []int32, sa, freq, bucket []int32)
suffixarray/sais2.go:386
↓ 1 callersFunctionplaceLMS_64
(text []int64, sa, freq, bucket []int64)
suffixarray/sais2.go:451
↓ 1 callersFunctionplaceLMS_8_32
The SAIS algorithm proceeds in a sequence of scans through sa. Each of the following functions implements one scan, and the functions appear here in t
suffixarray/sais.go:287
↓ 1 callersFunctionplaceLMS_8_64
(text []byte, sa, freq, bucket []int64)
suffixarray/sais2.go:320
↓ 1 callersFunctionreadInt64FromFile
(filename string)
files.go:81
↓ 1 callersFunctionreadSlice
readSlice reads data[:n] from r and returns n. It uses buf to buffer the read.
suffixarray/suffixarray.go:123
↓ 1 callersFunctionreadStringFromFile
(filename string)
files.go:311
↓ 1 callersFunctionretrieve
Uses binary search to find the occurrences of a query in the suffix array. Returns the starting position of the occurences.
suffixarray_utils.go:133
↓ 1 callersFunctionretrieveNum
Retrieve the number of occurrences of a query in the suffix array.
suffixarray_utils.go:151
↓ 1 callersMethodretrieveNum
(corpusVec TokenArray, query []byte)
suffixarray_utils.go:9
↓ 1 callersFunctionretrieveSubstrings
Retrieve all occurrences of a query in the suffix array. The returned occurrences are extended by extend tokens.
suffixarray_utils.go:163
↓ 1 callersMethodretrieveSubstrings
retrieve number of continuations
suffixarray_utils.go:10
next →1–100 of 139, ranked by callers