NLP : variations of a text without modifying it's meaning I am currently working on the automation of recurring reports (weekly 30-50 pages reports for around 100 districts). Those reports have a mostly fixed form : maps, graphs, data tables and small zone of text.

Apart for some discussion around colors and legends, it isn't difficult to automate the production of maps / graphs / tables. (I work with Rmarkdown if you want to know)

However, for the text, a simple approach like writing 'r value' in markdown to produce a variable value inside of the text feel 'too automated'. The reports end up having ten sentences like 'During the last quarter (QX 201X) total result was XXX (a +X% growth compared to the same quarter the previous year).'

I'd like to get automatic variations of that phrase without modyfiying it's meaning. I've ended up writing half a dozen variations myself. But (1) it still feels repetitive and unnatural, and (2) doing it for every phrase of the report may take a lot of time.

We have seen a lot of extraordinary things in transfering things for visual representation (see : https://en.wikipedia.org/wiki/Neural_Style_Transfer). So I was wondering if we have similar things for NLP, that would allow a text to be rewritten using a different 'style' (a neutral style -or an absence of style- in my case), keeping it's main content. The main paper I found on the subject is titled 'What is wrong with style transfer for texts?' and shows why style transfer doesn't really work for texts. Given (1) the constraint (keeping the same meaning) and (2) it's formalism (I know which number should be shown), I feel like the problem may be simpler than the whole style transfert.

Any idea where to start to automatically write variations of a text while keeping it's meaning constant ?
Text summarization can be divided into two categories 1. Extractive Summarization and  2. Abstractive Summarization

Extractive Summarization: These methods rely on extracting several parts, such as phrases and sentences, from a piece of text and stack them together to create a summary. Therefore, identifying the right sentences for summarization is of utmost importance in an extractive method.
Abstractive Summarization: Abstractive methods select words based on semantic understanding, even those words did not appear in the source documents. It aims at producing important material in a new way. They interpret and examine the text using advanced natural language techniques to generate a new shorter text that conveys the most critical information from the original text.

What you are looking for is abstractive summarisation. Since you are working in R there is a nice library called lexRank taking an example from here would look something like
#load needed packages
library(xml2)
library(rvest)
library(lexRankr)

#url to scrape
monsanto_url = &quot;https://www.theguardian.com/environment/2017/sep/28/monsanto-banned-from-european-parliament&quot;
   
#read page html
page = xml2::read_html(monsanto_url)
#extract text from page html using selector
page_text = rvest::html_text(rvest::html_nodes(page, &quot;.js-article__body p&quot;))

#perform lexrank for top 3 sentences
top_3 = lexRankr::lexRank(page_text,
                          #only 1 article; repeat same docid for all of input vector
                          docId = rep(1, length(page_text)),
                          #return 3 sentences to mimick /u/autotldr's output
                          n = 3,
                          continuous = TRUE)

#reorder the top 3 sentences to be in order of appearance in article
order_of_appearance = order(as.integer(gsub(&quot;_&quot;,&quot;&quot;,top_3$sentenceId)))
#extract sentences in order of appearance
ordered_top_3 = top_3[order_of_appearance, &quot;sentence&quot;]

&gt; ordered_top_3
[1] &quot;Monsanto lobbyists have been banned from entering the European parliament after the multinational refused to attend a parliamentary hearing into allegations of regulatory interference.&quot;
[2] &quot;Monsanto officials will now be unable to meet MEPs, attend committee meetings or use digital resources on parliament premises in Brussels or Strasbourg.&quot;                                
[3] &quot;A Monsanto letter to MEPs seen by the Guardian said that the European parliament was not “an appropriate forum” for discussion on the issues involved.&quot;  

EDIT: How I like to think about abstractive summarisation: Y
Using encoder-decoder architecture (extendended with transformers) for seq2seq problems you can essentially get an embeding of your text, where same sentences can be embedded differently in different context, giving same/similiar output.