From d1f811e1ec9afbbe99b9b6183824dcfab1c14516 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 19 Nov 2025 15:10:09 +0000 Subject: [PATCH 1/2] Add alias --- r/NAMESPACE | 1 + r/R/llm-summarize.R | 6 ++++++ r/man/llm_summarize.Rd | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/r/NAMESPACE b/r/NAMESPACE index 2d2244d..45676a9 100644 --- a/r/NAMESPACE +++ b/r/NAMESPACE @@ -22,6 +22,7 @@ export(llm_classify) export(llm_custom) export(llm_extract) export(llm_sentiment) +export(llm_summarise) export(llm_summarize) export(llm_translate) export(llm_use) diff --git a/r/R/llm-summarize.R b/r/R/llm-summarize.R index 91cee6a..f7126a5 100644 --- a/r/R/llm-summarize.R +++ b/r/R/llm-summarize.R @@ -2,6 +2,8 @@ #' #' @description #' Use a Large Language Model (LLM) to summarize text +#' +#' `llm_summarize()` and `llm_summarise()` are synonyms. #' #' @inheritParams llm_classify #' @param max_words The maximum number of words that the LLM should use in the @@ -44,6 +46,10 @@ llm_summarize <- function(.data, UseMethod("llm_summarize") } +#' @rdname llm_summarize +#' @export +llm_summarise <- llm_summarize + #' @export llm_summarize.data.frame <- function(.data, col, diff --git a/r/man/llm_summarize.Rd b/r/man/llm_summarize.Rd index 86e8df5..b273345 100644 --- a/r/man/llm_summarize.Rd +++ b/r/man/llm_summarize.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/llm-summarize.R \name{llm_summarize} \alias{llm_summarize} +\alias{llm_summarise} \alias{llm_vec_summarize} \title{Summarize text} \usage{ @@ -13,6 +14,14 @@ llm_summarize( additional_prompt = "" ) +llm_summarise( + .data, + col, + max_words = 10, + pred_name = ".summary", + additional_prompt = "" +) + llm_vec_summarize(x, max_words = 10, additional_prompt = "", preview = FALSE) } \arguments{ @@ -41,6 +50,8 @@ Applies to vector function only.} } \description{ Use a Large Language Model (LLM) to summarize text + +\code{llm_summarize()} and \code{llm_summarise()} are synonyms. } \examples{ \donttest{ From afdd65288ab1d7770941db440b28e70881c76430 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 19 Nov 2025 15:19:04 +0000 Subject: [PATCH 2/2] Add aliases to Python too --- python/mall/llmvec.py | 2 ++ python/mall/polars.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/python/mall/llmvec.py b/python/mall/llmvec.py index 840b878..f040301 100644 --- a/python/mall/llmvec.py +++ b/python/mall/llmvec.py @@ -85,6 +85,8 @@ def summarize(self, x, max_words=10, additional="") -> list: use=self._use, ) + summarise = summarize + def translate(self, x, language="", additional="") -> list: """Translate text into another language. diff --git a/python/mall/polars.py b/python/mall/polars.py index cada94a..e2dc0ed 100644 --- a/python/mall/polars.py +++ b/python/mall/polars.py @@ -203,6 +203,8 @@ def summarize( ) return df + summarise = summarize + def translate( self, col,