Skip to contents

Ids 0-4 are [BOS] [EOS] [SEP] [PAD] [UNK] (PAD = 3); the concept tokens follow, sorted and de-duplicated. With mask_token = TRUE id 5 is a fixed [MASK] (concepts start at 6) so the special-token embedding rows line up across vocabularies and sites; without it [MASK] is vocab_size (legacy layout). Both load with import_concept_vocabulary().

Usage

build_concept_tokenizer(concept_tokens, mask_token = FALSE)

Arguments

concept_tokens

character vector of concept token strings (for example "201826 - condition - T2DM").

mask_token

reserve the fixed [MASK] id 5.

Value

A list with concept_list, concept_map (named integer ids), vocab_size, n_special_tokens and mask_token_id.