Is your feature request related to a problem? Please describe.
Having a field with the length of text in terms of tokens helps with calculating the "cost" of sending the text to an LLM. Vespa already has an embedder which is type="hugging-face-tokenizer" that spits out token ids. Currently, a custom docproc is needed to get the token count.
Describe the solution you'd like
Indexing language should have an operator that given an array returns the lenght of the array.
Describe alternatives you've considered
A custom document processor to get the job done.
Additional context
https://docs.vespa.ai/en/reference/writing/indexing-language.html#get_language
Is your feature request related to a problem? Please describe.
Having a field with the length of text in terms of tokens helps with calculating the "cost" of sending the text to an LLM. Vespa already has an embedder which is
type="hugging-face-tokenizer"that spits out token ids. Currently, a custom docproc is needed to get the token count.Describe the solution you'd like
Indexing language should have an operator that given an array returns the lenght of the array.
Describe alternatives you've considered
A custom document processor to get the job done.
Additional context
https://docs.vespa.ai/en/reference/writing/indexing-language.html#get_language