This task is well known to summarize longer text into shorter text. Be careful, some models have a maximum length of input. That means that the summary cannot handle full books for instance. Be careful when choosing your model.
Examples
if (FALSE) { # \dontrun{
# Load the default model and use local inference
ez <- hf_ez_summarization()
text <- paste(
"The Eiffel Tower is 324 metres tall and located in Paris.",
"It was the world's tallest man-made structure for 41 years."
)
ez$infer(string = text, min_length = 10, max_length = 40)
# Load a specific model and use the API for inference.
ez <- hf_ez_summarization(model_id = 'xlm-roberta-base', use_api = TRUE)
ez$infer(string = "huggingface is the <mask>!")
} # }