Skip to content

Indexing language function to get size of an array #36939

Description

@dainiusjocas

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions