SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.12995 · ACL · 2021

PROTAUGMENT: Unsupervised diverse short-texts paraphrasing for intent detection meta-learning

Thomas Dopierre, Christophe Gravier, Wilfried Logerais, Jean Monnet

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2105.12995.json · badge: /api/ran/2105.12995.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
tdopierre/ProtAugment marked official in Papers with Code
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
FewShotDataset Ran
ran on a synthesized input
tdopierre/ProtAugment/models/proto/protaugment.py
code served (permissive licence) · get_code("1c8ed81c2afae8c0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned dict. 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 collections
import numpy as np
import random
import json
import tempfile
import os

def get_jsonl_data(jsonl_path: str):
    assert jsonl_path.endswith('.jsonl')
    out = list()
    with open(jsonl_path, 'r', encoding='utf-8') as file:
        for line in file:
            j = json.loads(line.strip())
            out.append(j)
    return out

def get_txt_data(txt_path: str):
    assert txt_path.endswith('.txt')
    with open(txt_path, 'r') as file:
        return [line.strip() for line in file.readlines()]

class FewShotDataset:

    def __init__(self, data_path: str, n_classes: int, n_support: int, n_query: int, labels_path: str=None):
        self.data_path = data_path
        self.labels_path = labels_path
        self.n_classes = n_classes
        self.n_support = n_support
        self.n_query = n_query
        self.data = None
        self.counter = None
        self.load_file(data_path, labels_path)

    def load_file(self, data_path: str, labels_path: str=None):
        data = get_jsonl_data(data_path)
        if labels_path:
            labels = get_txt_data(labels_path)
        else:
            labels = sorted(set([item['label'] for item in data]))
        labels_dict = collections.defaultdict(list)
        for item in data:
            if item['label'] in labels:
                labels_dict[item['label']].append(item)
        labels_dict = dict(labels_dict)
        for key, val in labels_dict.items():
            random.shuffle(val)
        self.data = labels_dict
        self.counter = {key: 0 for key, _ in self.data.items()}

    def get_episode(self):
        episode = dict()
        if self.n_classes:
            assert self.n_classes <= len(self.data.keys())
            rand_keys = np.random.choice(list(self.data.keys()), self.n_classes, replace=False)
            assert min([len(val) for val in self.data.values()]) >= self.n_support + self.n_query
            for key in rand_keys:
                random.shuffle(self.data[key])
            if self.n_support:
                episode['xs'] = [[self.data[k][i] for i in range(self.n_support)] for k in rand_keys]
            if self.n_query:
                episode['xq'] = [[self.data[k][self.n_support + i] for i in range(self.n_query)] for k in rand_keys]
        return episode

    def __len__(self):
        return sum([len(label_data) for label, label_data in self.data.items()])


# Create temporary JSONL file with test data
temp_dir = tempfile.mkdtemp()
jsonl_path = os.path.join(temp_dir, 'test_data.jsonl')

with open(jsonl_path, 'w') as f:
    for class_id in range(3):
        for item_id in range(10):
            data_item = {
                'label': f'class_{class_id}',
                'text': f'sample_{item_id}',
                'value': item_id
            }
            f.write(json.dumps(data_item) + '\n')

INIT_ARGS = {
    'data_path': jsonl_path,
    'n_classes': 2,
    'n_support': 3,
    'n_query': 2,
    'labels_path': None
}

ARGS = {}

METHOD = 'get_episode'

if __name__ == '__main__':
    dataset = FewShotDataset(**INIT_ARGS)
    result = dataset.get_episode()
    print("Episode keys:", result.keys())
    if 'xs' in result:
        print("Support set shape: {} classes x {} samples".format(len(result['xs']), len(result['xs'][0])))
    if 'xq' in result:
        print("Query set shape: {} classes x {} samples".format(len(result['xq']), len(result['xq'][0])))
    print("Dataset length:", len(dataset))
    
    import shutil
    shutil.rmtree(temp_dir)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
cosine_similarity Ran
ran; our contract draft was wrong, not the code
tdopierre/ProtAugment/models/proto/protaugment.py
code served (permissive licence) · get_code("3ae294e827bbb579")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 3) 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

torch.manual_seed(0)

# Create two small tensors with distinct dimensions
# x: batch_size=2, embedding_dim=4
# y: batch_size=3, embedding_dim=4
x = torch.randn(2, 4)
y = torch.randn(3, 4)

ARGS = {
    "x": x,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
get_jsonl_data Ran
ran; our contract draft was wrong, not the code
tdopierre/ProtAugment/models/proto/protaugment.py
code served (permissive licence) · get_code("0487849f056bb900")
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) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was 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 json
import tempfile
import os

# Create a temporary JSONL file with sample data
temp_dir = tempfile.mkdtemp()
jsonl_path = os.path.join(temp_dir, 'test_data.jsonl')

# Write sample JSONL data
sample_data = [
    {"id": 1, "text": "hello world"},
    {"id": 2, "text": "foo bar"},
    {"id": 3, "text": "test data"}
]

with open(jsonl_path, 'w', encoding='utf-8') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    'jsonl_path': jsonl_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 list, ndim 1, dtype family float — a list 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
get_txt_data Ran
ran; our contract draft was wrong, not the code
tdopierre/ProtAugment/models/proto/protaugment.py
code served (permissive licence) · get_code("1f7856529205269a")
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) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was 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 tempfile
import os

# Create a temporary text file with some sample data
temp_dir = tempfile.mkdtemp()
txt_path = os.path.join(temp_dir, "sample.txt")

with open(txt_path, 'w') as f:
    f.write("line one\n")
    f.write("line two with spaces  \n")
    f.write("line three\n")

ARGS = {
    'txt_path': txt_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 list, ndim 1, dtype family float — a list 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
BERTEncoder Not yet run
unverified (harvested, no recorded run)
tdopierre/ProtAugment/models/proto/protaugment.py
code served (permissive licence) · get_code("4866268f11cbb765")
How it ran

no invocation recorded.

ProtAugmentNet Not yet run
unverified (harvested, no recorded run)
tdopierre/ProtAugment/models/proto/protaugment.py
code served (permissive licence) · get_code("1c64c175ce7fd8f8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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-22.

Repositories linked to this paper

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

Abstract

Recent research considers few-shot intent detection as a meta-learning problem: the model is learning to learn from a consecutive set of small tasks named episodes. In this work, we propose PROTAUGMENT, a meta-learning algorithm for short texts classification applied to the intent detection task. PROTAUG-MENT is a novel extension of Prototypical Networks (Snell et al., 2017) that limits over-fitting on the bias introduced by the few-shots classification objective at each episode. It relies on diverse paraphrasing: a conditional language model is first fine-tuned for paraphrasing, and diversity is later introduced at the decoding stage at each meta-learning episode. The diverse paraphrasing is unsupervised as it is applied to unlabelled data and then fueled to the Prototypical Network training objective as a consistency loss. PROTAUGMENT is the stateof-the-art method for intent detection metalearning, at no extra labeling efforts and without the need to fine-tune a conditional language model on a given application domain.

For agents

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

get_harvested_code_for_paper("2105.12995")
get_code_for_paper("2105.12995")
have("2105.12995")

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

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

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

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

Connect an agent — have() is free.