Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alasdairforsythe/tokenmonster
/ functions
Functions
381 in github.com/alasdairforsythe/tokenmonster
⨍
Functions
381
◇
Types & classes
47
Method
__del__
(self)
python/tokenmonster.py:183
Method
__del__
(self)
python/tokenmonster.py:263
Method
__init__
(self, parent)
python/tokenmonster.py:130
Method
__init__
(self, path, multiprocess_safe = False)
python/tokenmonster.py:190
Method
__len__
(self)
python/tokenmonster.py:270
Method
add_special_token
Add one or more special tokens. Returns: int: The new size of the vocabulary.
python/tokenmonster.py:814
Method
add_token
Add one or more regular tokens. Returns: int: The new size of the vocabulary.
python/tokenmonster.py:767
Method
binary_find
tokenmonster-cpp/src/tokenmonster.cpp:1200
Method
binary_longest
tokenmonster-cpp/src/tokenmonster.cpp:1221
Method
by_value
tokenmonster-cpp/src/tokenmonster.cpp:915
Method
bytes2uint64
tokenmonster-cpp/src/tokenmonster.cpp:919
Method
capcode
Returns the capcode level of the vocabulary. 0 = disabled 1 = only deleteToken 2 = enabled
python/tokenmonster.py:279
Method
charset
Returns one of "UTF-8", "UTF-16", "None"
python/tokenmonster.py:288
Method
constructor
()
javascript/tokenmonster.js:2
Method
constructor
()
javascript/tokenmonster.js:183
Method
constructor
()
javascript/tokenmonster.js:253
Method
constructor
()
javascript/tokenmonster.js:1008
Method
debug
(index)
javascript/tokenmonster.js:239
Method
decode
A decoder object used for decoding token streams. This decoder object is used instead of the vocabulary decode method when y
python/tokenmonster.py:136
Method
decode_serialized_raw
tokenmonster-cpp/src/tokenmonster.cpp:1427
Method
decoder
Returns a new decoder instance used for decoding tokens into text.
python/tokenmonster.py:273
Method
delete_token
Delete one or more regular or special tokens. You can give the token in either its encoded or decoded form. Returns:
python/tokenmonster.py:776
Method
delete_token_by_id
Delete one or more regular or special token by specifying the token ID. Returns: int: The new size of the vocabulary.
python/tokenmonster.py:786
Method
denormalize
tokenmonster-cpp/src/tokenmonster.cpp:3248
Method
detokenize
(tokens)
javascript/tokenmonster.js:258
Method
disable_unk_token
Disables the UNK token. Without an UNK token, any character for which there is no token is ignored during tokenization Retur
python/tokenmonster.py:860
Function
disconnect
Closes tokenmonsterserver subprocess.
python/tokenmonster.py:19
Method
enable_unk_token
Enables the UNK token. If enabled, the UNK token appears whenever there is a character that is not in the vocabulary. Note th
python/tokenmonster.py:848
Method
export_yaml
(self, order_by_score = False)
python/tokenmonster.py:893
Method
find0
tokenmonster-cpp/src/tokenmonster.cpp:960
Method
find1
tokenmonster-cpp/src/tokenmonster.cpp:1111
Method
find2
tokenmonster-cpp/src/tokenmonster.cpp:1156
Method
find3
tokenmonster-cpp/src/tokenmonster.cpp:1170
Method
find4
tokenmonster-cpp/src/tokenmonster.cpp:1184
Method
has_unk
tokenmonster-cpp/include/tokenmonster/tokenmonster.hpp:105
Method
highest_token_id
tokenmonster-cpp/src/tokenmonster.cpp:3255
Method
id_to_token
Get the token string from a single token ID, in it's capcode-encoded form. Parameters: id: int Returns:
python/tokenmonster.py:610
Method
id_to_token_decoded
Get the token string from a single token ID, in it's capcode-decoded form. Parameters: id: int Returns:
python/tokenmonster.py:627
Function
isLatin
(b []byte)
training/getalltokens.go:230
Function
isValid
(b []byte)
training/getalltokens.go:241
Function
isValidLatin
(b []byte)
training/getalltokens.go:271
Method
load
(url)
javascript/tokenmonster.js:303
Function
load_multiprocess_safe
Loads a TokenMonster vocabulary from file, URL or by name. It's safe for multiprocessing, but vocabulary modification is disabled and tokeniz
python/tokenmonster.py:42
Method
longest_length
tokenmonster-cpp/src/tokenmonster.cpp:879
Function
main
tokenmonster-cpp/tests/smoke.cpp:4
Function
main
tokenmonster-cpp/tests/bench.cpp:84
Function
main
tokenmonster-cpp/tests/unit.cpp:87
Function
main
tokenmonster-cpp/tests/dump.cpp:31
Function
main
()
benchmark/tokenmonster_bench.go:11
Function
main
()
benchmark/onlyvalidlatin.go:29
Function
main
()
training/mergetokens.go:107
Function
main
()
training/tokenmonsterserver.go:184
Function
main
()
training/getalltokens.go:1613
Function
main
()
training/trainvocab.go:1347
Function
main
()
training/exportvocab.go:104
Function
main
()
training/comparetokens.go:40
Method
mode
Returns the optimization mode of the vocabulary.
python/tokenmonster.py:298
Method
mode
tokenmonster-cpp/include/tokenmonster/tokenmonster.hpp:110
Method
modify_from_yaml
Modifies the vocabulary using a YAML file. A sample YAML file can be found here: https://github.com/alasdairforsythe/tokenmonster/yam
python/tokenmonster.py:740
Method
normalization
Returns the normalization of the vocabulary, e.g. "NFD trim"
python/tokenmonster.py:315
Method
normalization_code
tokenmonster-cpp/include/tokenmonster/tokenmonster.hpp:111
Method
operator()
tokenmonster-cpp/src/tokenmonster.cpp:908
Method
pack8
tokenmonster-cpp/src/tokenmonster.cpp:953
Method
read_uint32
tokenmonster-cpp/src/tokenmonster.cpp:153
Method
require
tokenmonster-cpp/src/tokenmonster.cpp:182
Method
reset_token_ids
Resets the token IDs to be sequential beginning from zero. If tokens have been deleted from the vocabulary there will be gaps in the
python/tokenmonster.py:839
Function
set_local_directory
The default directory for TokenMonster is ~/_tokenmonster Use this function to set the default directory elsewhere, before loading any vocabu
python/tokenmonster.py:12
Method
sort_limit
tokenmonster-cpp/src/tokenmonster.cpp:1229
Method
special_tokens
tokenmonster-cpp/src/tokenmonster.cpp:3212
Method
token_to_id
Returns the ID of a single token. This works for both capcode-encoded "raw" tokens, and their decoded form. Parameters:
python/tokenmonster.py:644
Method
tokenize
(text)
javascript/tokenmonster.js:446
Method
tokenize_count
Same as tokenize, but it returns only the number of tokens. The number of tokens is the same as you would get from `tokenize`. If yo
python/tokenmonster.py:485
Method
tokenize_count_normalized
tokenmonster-cpp/src/tokenmonster.cpp:1994
Method
tokenize_to_serialized16
tokenmonster-cpp/src/tokenmonster.cpp:2261
Method
tokenize_to_serialized24
tokenmonster-cpp/src/tokenmonster.cpp:2547
Method
tokenize_to_serialized32
tokenmonster-cpp/src/tokenmonster.cpp:2844
Method
tokens
tokenmonster-cpp/src/tokenmonster.cpp:3228
Method
tokens_detailed
tokenmonster-cpp/src/tokenmonster.cpp:3186
Function
trim
(b []byte)
training/getalltokens.go:391
Method
unk
tokenmonster-cpp/include/tokenmonster/tokenmonster.hpp:104
Method
unk_token_id
Returns the ID of the UNK token, or 'None' type if there is no UNK token Parameters: token: string Returns:
python/tokenmonster.py:660
← previous
301–381 of 381, ranked by callers