SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1703.03130 · 2017

A Structured Self-attentive Sentence Embedding

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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 6 have no contract verdict; 4 failures of our instrument; 0 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/1703.03130.json · badge: /api/ran/1703.03130.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
warnikchow/coaudiotext community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
paddorch/SelfAttnSent.paddle community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
roomylee/self-attentive-emb-tf community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
HiJiGOO/self-attentive reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
kaushalshetty/Structured-Self-Attention reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
F_score Ran
ran on a synthesized input
paddorch/SelfAttnSent.paddle/self_attn_sent/utils.py
code served (permissive licence) · get_code("da3b18d772dc8f1f")
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 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 torch
import numpy as np

torch.manual_seed(0)

# Construct precision and recall dictionaries
# The function expects dicts where keys are labels and values are numeric scores
p = {
    'label_A': 0.8,
    'label_B': 0.6,
    'label_C': 0.0,
    'label_D': 0.9
}

r = {
    'label_A': 0.75,
    'label_B': 0.0,
    'label_C': 0.0,
    'label_D': 0.85
}

ARGS = {
    'p': p,
    'r': r
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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: none by the harness; any seed is in the setup block
cho2onehot Ran
ran on a synthesized input
warnikchow/coaudiotext/han2one.py
code served (permissive licence) · get_code("4f425858112c1b43")
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 ndarray, ndim 1, dtype family float, shape (19,) 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 numpy as np

choseng = ['ㄱ', 'ㄴ', 'ㄷ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅅ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ', 'ㄲ', 'ㄸ', 'ㅃ', 'ㅆ', 'ㅉ']

def cho2onehot(s):
    res = np.zeros(len(choseng))
    if s in choseng:
        res[choseng.index(s)] = 1
    return res

ARGS = {
    's': 'ㄱ'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (19,) — shape (19,) 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
clean_str Ran
ran; our contract draft was wrong, not the code
roomylee/self-attentive-emb-tf/data_helpers.py
pointer only (licence: MIT); the stored copy get_code serves, from audqhsid/-Review-CNN-for-Sentence-Classification, is pointer only (licence: NONE) · get_code("efe1a86fd9a2468e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from audqhsid/-Review-CNN-for-Sentence-Classification, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

con2onehot Ran
ran on a synthesized input
warnikchow/coaudiotext/han2one.py
code served (permissive licence) · get_code("b4b9fac0046d2067")
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 ndarray, ndim 1, dtype family float, shape (27,) 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 numpy as np

congseng = ['ㄱ', 'ㄴ', 'ㄷ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅅ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ', 'ㄲ', 'ㅆ', 'ㄳ', 'ㄵ', 'ㄶ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ', 'ㄾ', 'ㄿ', 'ㅀ', 'ㅄ']

def con2onehot(s):
    res = np.zeros(len(congseng))
    if s in congseng:
        res[congseng.index(s)] = 1
    return res

ARGS = {
    's': 'ㄱ'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (27,) — shape (27,) 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
cwu2onehot Ran
ran on a synthesized input
warnikchow/coaudiotext/han2one.py
code served (permissive licence) · get_code("166e995944ac3cdb")
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 ndarray, ndim 1, dtype family float, shape (21,) 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 numpy as np

cwungseng = ['ㅏ', 'ㅑ', 'ㅓ', 'ㅕ', 'ㅗ', 'ㅛ', 'ㅜ', 'ㅠ', 'ㅡ', 'ㅣ', 'ㅐ', 'ㅒ', 'ㅔ', 'ㅖ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅝ', 'ㅞ', 'ㅟ', 'ㅢ']

def cwu2onehot(s):
    res = np.zeros(len(cwungseng))
    if s in cwungseng:
        res[cwungseng.index(s)] = 1
    return res

# Test with a valid Korean vowel character
test_input = 'ㅏ'

ARGS = {
    's': test_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (21,) — shape (21,) 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
json_to_dict Ran
ran; our contract draft was wrong, not the code
kaushalshetty/Structured-Self-Attention/classification.py
code served (permissive licence) · get_code("ecc1307775a708aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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.

ARGS = {
    'json_set': {
        'key1': 'True',
        'key2': 'False',
        'key3': 'some_string',
        'key4': '123',
        'key5': 'True',
        'key6': 'False'
    }
}
Setup block drafted by
a language model, Claude Sonnet 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 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: none by the harness; any seed is in the setup block
load_data_and_labels Ran
ran on a synthesized input
roomylee/self-attentive-emb-tf/data_helpers.py
code served (permissive licence) · get_code("27e5a1edfa3a516d")
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. 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 tempfile
import os
import csv
import numpy as np

# Create a temporary CSV file with test data
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, "test_data.csv")

# Write test data to CSV
with open(csv_path, 'w', newline='') as f:
    writer = csv.writer(f, delimiter=',', quotechar='"')
    writer.writerow(['1', 'This is great!', 'Amazing product'])
    writer.writerow(['2', 'Not bad', 'Could be better'])
    writer.writerow(['1', "It's wonderful", 'Really love it!'])

ARGS = {
    "path": csv_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
precision_recall Ran
ran on a synthesized input
paddorch/SelfAttnSent.paddle/self_attn_sent/utils.py
code served (permissive licence) · get_code("c01024271e313d54")
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. 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
import numpy as np

torch.manual_seed(0)

# The function precision_recall takes two parameters:
# - output: a sequence of predicted labels
# - target: a sequence of true labels
# The function iterates through them with len() and compares elements
# It treats them as sequences that can be indexed and len() can be called on them

# Create simple list-based label sequences
output = [0, 1, 0, 1, 2, 2]
target = [0, 1, 1, 1, 2, 1]

ARGS = {
    "output": output,
    "target": target
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
string_parser Ran
ran; our contract draft was wrong, not the code
HiJiGOO/self-attentive/code/self-attentive.py
pointer only (licence: NONE) · get_code("5e9d3d663b78a270")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HiJiGOO/self-attentive when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

token_parse Ran
ran; our contract draft was wrong, not the code
HiJiGOO/self-attentive/code/self-attentive.py
pointer only (licence: NONE) · get_code("39e95d3164e07875")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HiJiGOO/self-attentive when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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.

FunctionAlso present inEarliest-datedOthers named
clean_str 9 other papers
3 dated earlier, 6 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1510.03820 (2015-10)
A Sensitivity Analysis of (and Practitioners' Guide to) Convolutional Neural Networks for Sentence Classification
1608.06019 (2016-08)
Domain Separation Networks
and 6 more not named here
F_score 1 other paper
1 dated earlier
1509.01626 (2015-09)
Character-level Convolutional Networks for Text Classification *
precision_recall 1 other paper
1 dated earlier
1509.01626 (2015-09)
Character-level Convolutional Networks for Text Classification *

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

More are linked than shown here.

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

Abstract

This paper proposes a new model for extracting an interpretable sentence embedding by introducing self-attention. Instead of using a vector, we use a 2-D matrix to represent the embedding, with each row of the matrix attending on a different part of the sentence. We also propose a self-attention mechanism and a special regularization term for the model. As a side effect, the embedding comes with an easy way of visualizing what specific parts of the sentence are encoded into the embedding. We evaluate our model on 3 different tasks: author profiling, sentiment classification, and textual entailment. Results show that our model yields a significant performance gain compared to other sentence embedding methods in all of the 3 tasks.

For agents

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

get_harvested_code_for_paper("1703.03130")
get_code_for_paper("1703.03130")
have("1703.03130")

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

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

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

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

Connect an agent — have() is free.