SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.09055 · 2023

Don't lose the message while paraphrasing: A study on content preserving style transfer

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2308.09055.json · badge: /api/ran/2308.09055.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
s-nlp/lewit-informal canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
adjust_money Ran
ran; our contract draft was wrong, not the code
s-nlp/lewit-informal/metrics/ner_utils.py
code served (permissive licence) · get_code("e1066cf6fc833d5a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def adjust_money(token):
    token = re.sub('_\\$_', '_dollars_', token)
    return token

ARGS = {
    'token': '_$_test_$_string'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_model Ran
ran; our contract draft was wrong, not the code
s-nlp/lewit-informal/metrics/evaluation.py
code served (permissive licence) · get_code("b039f50597b1f636")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoModelForCausalLM
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal mock model that satisfies the function's usage
class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, input_ids, attention_mask=None):
        return self.linear(input_ids.float())
    
    @classmethod
    def from_pretrained(cls, model_name, use_auth_token=None):
        return cls()

# Create a minimal mock tokenizer that satisfies the function's usage
class MockTokenizer:
    def __init__(self):
        self.model_max_length = 512
    
    @classmethod
    def from_pretrained(cls, model_name, use_auth_token=None):
        return cls()
    
    def __call__(self, text, return_tensors=None):
        return {
            'input_ids': torch.tensor([[101, 2054, 2003, 102]]),
            'attention_mask': torch.tensor([[1, 1, 1, 1]])
        }

# Construct valid arguments for load_model
model_instance = MockModel()
tokenizer_instance = MockTokenizer()

ARGS = {
    'model_name': None,
    'model': model_instance,
    'tokenizer': tokenizer_instance,
    'model_class': AutoModelForSequenceClassification,
    'use_auth_token': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
norm_dates Ran
ran; our contract draft was wrong, not the code
s-nlp/lewit-informal/metrics/ner_utils.py
code served (permissive licence) · get_code("605c11e7a92d1701")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

ones_C = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']

ones_O = ['zero', 'first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth', 'thirteenth', 'fourteenth', 'fifteenth', 'sixteenth', 'seventeenth', 'eighteenth', 'nineteenth']

tens_C = ['zero', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']

tens_O = ['zero', 'tenth', 'twentieth', 'thirtieth', 'fortieth', 'fiftieth', 'sixtieth', 'seventieth', 'eightieth', 'ninetieth']

months = ['January', 'January', 'February', 'February', 'March', 'March', 'April', 'April', 'May', 'May', 'June', 'June', 'July', 'July', 'August', 'August', 'September', 'September', 'October', 'November', 'December']

mm = '(?P<month>' + '|'.join(list({m.lower() for m in months})) + ')'

osmall = '((?P<tenth>' + '|'.join(tens_C + tens_O) + ')_)?(?P<oneth>' + '|'.join(ones_O + ones_C) + ')'

me1 = re.compile(mm + '_' + osmall)

me2 = re.compile(osmall + '_of_' + mm)

def norm_dates(text):
    for pattern in [me1, me2]:
        start_id = 0
        spans = []
        for match in re.finditer(pattern, text):
            gd = match.groupdict()
            if gd['oneth']:
                ones = ones_C.index(gd['oneth']) if gd['oneth'] in ones_C else ones_O.index(gd['oneth'])
            else:
                ones = 0
            if gd['tenth']:
                tens = tens_C.index(gd['tenth']) if gd['tenth'] in tens_C else tens_O.index(gd['tenth'])
            else:
                tens = 0
            normed = gd['month']
            if tens:
                normed += '_' + tens_C[tens]
            if ones:
                normed += '_' + ones_C[ones]
            first, last = match.span()
            spans.append(text[start_id:first])
            spans.append(normed)
            start_id = last
        spans.append(text[start_id:])
        text = ''.join(spans)
    return text

ARGS = {
    'text': 'The meeting is on january_first and we will meet at january_twenty_third. Also on first_of_march.'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
prepare_target_label Ran
ran, honoured the contract we drafted
s-nlp/lewit-informal/metrics/evaluation.py
code served (permissive licence) · get_code("7c6eab7df3e9cd08")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class MockConfig:
    def __init__(self):
        self.id2label = {0: "negative", 1: "positive", 2: "neutral"}
        self.label2id = {"negative": 0, "positive": 1, "neutral": 2}

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MockConfig()
    
    def forward(self, x):
        return x

torch.manual_seed(0)
model = MockModel()
target_label = "positive"

ARGS = {
    "model": model,
    "target_label": target_label
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_emoji Ran
ran; our contract draft was wrong, not the code
s-nlp/lewit-informal/lewip_informal/utils.py
code served (permissive licence) · get_code("a2391d082935defb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

EMOJI_PATTERN = re.compile('([\U0001f1e0-🇿🌀-🗿😀-🙏🚀-\U0001f6ff🜀-🝿🞀-\U0001f7ff🠀-\U0001f8ff🤀-🧿🨀-\U0001fa6f🩰-\U0001faff☀-⭕])', flags=re.UNICODE)

def remove_emoji(text):
    return EMOJI_PATTERN.sub('', text)

ARGS = {
    "text": "Hello 🎉 World 😀 This is a test 🚀"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_hashtags Ran
ran; our contract draft was wrong, not the code
s-nlp/lewit-informal/lewip_informal/utils.py
code served (permissive licence) · get_code("536e01b6e8cf634d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

HASHTAG_PATTERN = re.compile('#(\\w+)', flags=re.UNICODE)

def remove_hashtags(text):
    return HASHTAG_PATTERN.sub('', text)

ARGS = {
    'text': 'Hello #world this is a #test with #hashtags and #more content'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_urls Ran
ran; our contract draft was wrong, not the code
s-nlp/lewit-informal/lewip_informal/utils.py
code served (permissive licence) · get_code("1ce6f12c5252b26e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

URL_PATTERN = re.compile('(http\\S+|www\\.\\S+)', flags=re.UNICODE)

def remove_urls(text):
    return URL_PATTERN.sub('', text)

ARGS = {
    'text': 'Check out http://example.com and www.google.com for more info'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
classify_texts Not yet run
unverified (harvested, no recorded run)
s-nlp/lewit-informal/metrics/evaluation.py
code served (permissive licence) · get_code("d02123b4cd03a4df")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Text style transfer techniques are gaining popularity in natural language processing allowing paraphrasing text in the required form: from toxic to neural, from formal to informal, from old to the modern English language, etc. Solving the task is not sufficient to generate some neural/informal/modern text, but it is important to preserve the original content unchanged. This requirement becomes even more critical in some applications such as style transfer of goal-oriented dialogues where the factual information shall be kept to preserve the original message, e.g. ordering a certain type of pizza to a certain address at a certain time. The aspect of content preservation is critical for real-world applications of style transfer studies, but it has received little attention. To bridge this gap we perform a comparison of various style transfer models on the example of the formality transfer domain. To perform a study of the content preservation abilities of various style transfer methods we create a parallel dataset of formal vs. informal task-oriented dialogues. The key difference between our dataset and the existing ones like GYAFC [17] is the presence of goal-oriented dialogues with predefined semantic slots essential to be kept during paraphrasing, e.g. named entities. This additional annotation allowed us to conduct a precise comparative study of several state-of-the-art techniques for style transfer. Another result of our study is a modification of the unsupervised method LEWIS [19] which yields a substantial improvement over the original method and all evaluated baselines on the proposed task.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2308.09055")
get_code_for_paper("2308.09055")
have("2308.09055")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2308.09055.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2308.09055.svg)](https://syntology.ai/paper/2308.09055)

Connect an agent — have() is free.