Functions

Functions available in the query language.

abs
abs(expr)

Returns the absolute value of the input.

add
add(expr1, expr2)

Adds the two inputs.

and
and(expr1, expr2)

Logical and operation of two boolean columns.

automated_readability_index
automated_readability_index(text)

Returns the ARI (Automated Readability Index) which outputs a number that approximates the grade level needed to comprehend the text. For example if the ARI is 6.5, then the grade level to comprehend the text is 6th to 7th grade.

bleu
bleu(output, reference)

Computes the BLEU score between two columns.

character_count
character_count(text)

Returns the number of characters in a text column.

  • Aliases

    • num_chars

coalesce

Return the first expression that evaluates to a non-null value.

concat

Concatenates multiple text columns into one.

contains

Returns true if the input string contains the substring.

divide

Divides the two inputs.

embed

Returns the embedding of a text column. Embedding model: all-mpnet-base-v2.

equal_to

Computes the element-wise equal to comparison of two columns.

  • Aliases

    • eq

filter

Filters a column using another column as a mask.

flesch_kincaid_grade

Returns the Flesch-Kincaid Grade of the given text. This is a grade formula in that a score of 9.3 means that a ninth grader would be able to read the document.

greater_than

Computes the element-wise greater than comparison of two columns. input1 > input2

  • Aliases

    • gt

greater_than_or_equal_to

Computes the element-wise greater than or equal to comparison of two columns. input1 >= input2

  • Aliases

    • gte

is_valid_json

Returns true if the input string is valid json.

less_than

Computes the element-wise less than comparison of two columns. input1 < input2

  • Aliases

    • lt

less_than_or_equal_to

Computes the element-wise less than or equal to comparison of two columns. input1 <= input2

  • Aliases

    • lte

levenshtein

Returns Damerau-Levenshtein distance between two strings.

list_contains

Returns True if the list contains the value.

list_extract

Extracts the item at the given index from a list.

list_has_duplicate

Returns True if the list has duplicated items.

list_length

Returns the length of lists in a list column.

list_most_common

Most common item in list.

list_starts_with

Returns True if the list starts with the value.

list_zip

Zips multiple lists into a list of structs.

llm_answer_groundedness

Judge if the answer is adhering to the context

llm_answer_refusal

Judge if the answer is a refusal to answer the question

llm_answer_relevancy

Judge if the answer is relevant to the question

  • Aliases

    • rag_answer_relevancy

llm_classify

Classify text into custom categories using an LLM.

llm_context_relevancy

LLM as Judge if the contexts are relevant to the question

llm_question_clarity

Judge if the question is clear

llm_score

Score text using an LLM.

llm_summarization

Summarize the input and output of a conversational system.

llm_text_frustration

Judge the frustration of text (default to input) on a scale of 1 to 5.

llm_text_sentiment

Judge the sentiment of a text as positive, negative, or neutral.

  • Aliases

    • text_sentiment

llm_text_similarity

Judge the similarity of an output on a scale of 1 to 5, as compared to a target.

  • Aliases

    • text_similarity

llm_text_toxicity

Judge the toxicity of a text on a scale of 1 to 5.

map_extract

Extracts the value for a given key from a map, returning null if the key is not in the map.

multiply

Multiplies the two inputs.

negate

Returns the negation of the input.

not

Logical not operation of a boolean column.

not_equal_to

Computes the element-wise not equal to comparison of two columns.

  • Aliases

    • neq

or

Logical or operation of two boolean columns.

rouge1

Returns the rouge1 score between two columns.

rouge2

Returns the rouge2 score between two columns.

rougeL

Returns the rougeL score between two columns.

rougeLsum

Returns the rougeLsum score between two columns.

sentence_count

Returns the number of sentences in a text column.

  • Aliases

    • num_sentences

struct_extract

Extracts a field from a struct expression.

subtract

Subtracts the two inputs.

token_count

Returns the number of tokens in a text column.

word_count

Returns the number of words in a text column.

  • Aliases

    • num_words

Was this helpful?