Encodes text into fixed-length token ID vectors with explicit padding semantics.
Summary
Functions
Encodes one string into exactly vector_length token IDs.
Encodes one string and also returns its active token count.
Functions
Encodes one string into exactly vector_length token IDs.
Tokens beyond the vector length are truncated. Shorter encodings are padded
with pad_token_id, which should come from BinClass.Tokenizer.metadata/1.
Encodes one string and also returns its active token count.
Returns {token_ids, active_token_count}. The token IDs are truncated and
padded to vector_length; the count is calculated after truncation and
excludes IDs equal to pad_token_id.