SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.08173 · ACL · 2024

Semi-Supervised Spoken Language Glossification

Wengang Zhou, Houqiang Li, Hao Zhou, Huijie Yao

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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 4 have no contract verdict; 0 failures of our instrument; 1 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/2406.08173.json · badge: /api/ran/2406.08173.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
yaohj11/S3LG community
Papers with Code archive
4 ran · 1 no recorded run
FunctionStatusWhere it lives
MultiHeadedAttention Ran
ran on a synthesized input
yaohj11/S3LG/model/seq2seq/encoder.py
code served (permissive licence) · get_code("4c756637a87da821")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 8) 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
from torch import Tensor

INIT_ARGS = {
    "num_heads": 2,
    "size": 8,
    "dropout": 0.1,
}

ARGS = {
    "k": torch.randn(2, 3, 8),
    "v": torch.randn(2, 3, 8),
    "q": torch.randn(2, 3, 8),
    "mask": torch.ones(2, 1, 3, dtype=torch.bool),
}

if __name__ == "__main__":
    from torch import Tensor
    import math

    class MultiHeadedAttention(nn.Module):
        """
        Multi-Head Attention module from "Attention is All You Need"

        Implementation modified from OpenNMT-py.
        https://github.com/OpenNMT/OpenNMT-py
        """

        def __init__(self, num_heads: int, size: int, dropout: float=0.1):
            """
            Create a multi-headed attention layer.
            :param num_heads: the number of heads
            :param size: model size (must be divisible by num_heads)
            :param dropout: probability of dropping a unit
            """
            super(MultiHeadedAttention, self).__init__()
            assert size % num_heads == 0
            self.head_size = head_size = size // num_heads
            self.model_size = size
            self.num_heads = num_heads
            self.k_layer = nn.Linear(size, num_heads * head_size)
            self.v_layer = nn.Linear(size, num_heads * head_size)
            self.q_layer = nn.Linear(size, num_heads * head_size)
            self.output_layer = nn.Linear(size, size)
            self.softmax = nn.Softmax(dim=-1)
            self.dropout = nn.Dropout(dropout)

        def forward(self, k: Tensor, v: Tensor, q: Tensor, mask: Tensor=None):
            """
            Computes multi-headed attention.

            :param k: keys   [B, M, D] with M being the sentence length.
            :param v: values [B, M, D]
            :param q: query  [B, M, D]
            :param mask: optional mask [B, 1, M]
            :return:
            """
            batch_size = k.size(0)
            num_heads = self.num_heads
            k = self.k_layer(k)
            v = self.v_layer(v)
            q = self.q_layer(q)
            k = k.view(batch_size, -1, num_heads, self.head_size).transpose(1, 2)
            v = v.view(batch_size, -1, num_heads, self.head_size).transpose(1, 2)
            q = q.view(batch_size, -1, num_heads, self.head_size).transpose(1, 2)
            q = q / math.sqrt(self.head_size)
            scores = torch.matmul(q, k.transpose(2, 3))
            if mask is not None:
                scores = scores.masked_fill(~mask.unsqueeze(1), float('-inf'))
            attention = self.softmax(scores)
            attention = self.dropout(attention)
            context = torch.matmul(attention, v)
            context = context.transpose(1, 2).contiguous().view(batch_size, -1, num_heads * self.head_size)
            output = self.output_layer(context)
            return output

    model = MultiHeadedAttention(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 3, 8)")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 3, dtype family float, shape (2, 3, 8) — shape (2, 3, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
PositionalEncoding Ran
ran on a synthesized input
yaohj11/S3LG/model/seq2seq/encoder.py
code served (permissive licence) · get_code("be8119c6581d2fb1")
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 Tensor, ndim 3, dtype family float, shape (2, 8, 4) 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
import math

class PositionalEncoding(nn.Module):
    """
    Pre-compute position encodings (PE).
    In forward pass, this adds the position-encodings to the
    input for as many time steps as necessary.

    Implementation based on OpenNMT-py.
    https://github.com/OpenNMT/OpenNMT-py
    """

    def __init__(self, size: int=0, max_len: int=5000):
        """
        Positional Encoding with maximum length max_len
        :param size:
        :param max_len:
        :param dropout:
        """
        if size % 2 != 0:
            raise ValueError('Cannot use sin/cos positional encoding with odd dim (got dim={:d})'.format(size))
        pe = torch.zeros(max_len, size)
        position = torch.arange(0, max_len).unsqueeze(1)
        div_term = torch.exp(torch.arange(0, size, 2, dtype=torch.float) * -(math.log(10000.0) / size))
        pe[:, 0::2] = torch.sin(position.float() * div_term)
        pe[:, 1::2] = torch.cos(position.float() * div_term)
        pe = pe.unsqueeze(0)
        super(PositionalEncoding, self).__init__()
        self.register_buffer('pe', pe)
        self.dim = size

    def forward(self, emb):
        """Embed inputs.
        Args:
            emb (FloatTensor): Sequence of word vectors
                ``(batch_size, seq_len, self.dim)``
        """
        return emb + self.pe[:, :emb.size(1)]


INIT_ARGS = {
    'size': 4,
    'max_len': 100
}

ARGS = {
    'emb': torch.randn(2, 8, 4)
}

if __name__ == '__main__':
    model = PositionalEncoding(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['emb'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 3, dtype family float, shape (2, 8, 4) — shape (2, 8, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
PositionwiseFeedForward Ran
ran on a synthesized input
yaohj11/S3LG/model/seq2seq/encoder.py
code served (permissive licence) · get_code("40933e301bb2d3be")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) 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 PositionwiseFeedForward(nn.Module):
    """
    Position-wise Feed-forward layer
    Projects to ff_size and then back down to input_size.
    """

    def __init__(self, input_size, ff_size, dropout=0.1):
        """
        Initializes position-wise feed-forward layer.
        :param input_size: dimensionality of the input.
        :param ff_size: dimensionality of intermediate representation
        :param dropout:
        """
        super(PositionwiseFeedForward, self).__init__()
        self.layer_norm = nn.LayerNorm(input_size, eps=1e-06)
        self.pwff_layer = nn.Sequential(nn.Linear(input_size, ff_size), nn.ReLU(), nn.Dropout(dropout), nn.Linear(ff_size, input_size), nn.Dropout(dropout))

    def forward(self, x):
        x_norm = self.layer_norm(x)
        return self.pwff_layer(x_norm) + x


INIT_ARGS = {
    'input_size': 4,
    'ff_size': 8,
    'dropout': 0.1
}

ARGS = {
    'x': torch.randn(2, 3, 4)
}

if __name__ == '__main__':
    model = PositionwiseFeedForward(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TransformerEncoderLayer Ran
ran on a synthesized input
yaohj11/S3LG/model/seq2seq/encoder.py
code served (permissive licence) · get_code("63d68ab12286b7a4")
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 Tensor, ndim 3, 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 torch.nn as nn
import numpy as np

# INIT_ARGS for TransformerEncoderLayer.__init__
INIT_ARGS = {
    'size': 8,
    'ff_size': 16,
    'num_heads': 2,
    'dropout': 0.1
}

# ARGS for TransformerEncoderLayer.forward
batch_size = 2
seq_len = 5
model_size = 8

x = torch.randn(batch_size, seq_len, model_size)
mask = torch.ones(batch_size, 1, seq_len, dtype=torch.bool)

ARGS = {
    'x': x,
    'mask': mask
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
EncoderTransformer Not yet run
unverified (harvested, no recorded run)
yaohj11/S3LG/model/seq2seq/encoder.py
code served (permissive licence) · get_code("d672612bcc1e12f8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 3 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
MultiHeadedAttention
brick of this paper's assembly: model
1 other paper
1 dated earlier
2303.05725 (2023-03)
CVT-SLR: Contrastive Visual-Textual Transformation for Sign Language Recognition with Variational Alignment
PositionwiseFeedForward
brick of this paper's assembly: model
1 other paper
1 dated earlier
2303.05725 (2023-03)
CVT-SLR: Contrastive Visual-Textual Transformation for Sign Language Recognition with Variational Alignment

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

Spoken language glossification (SLG) aims to translate the spoken language text into the sign language gloss, i.e., a written record of sign language. In this work, we present a framework named Semi-Supervised Spoken Language Glossification (S 3 LG) for SLG. To tackle the bottleneck of limited parallel data in SLG, our S 3 LG incorporates large-scale monolingual spoken language text into SLG training. The proposed framework follows the selftraining structure that iteratively annotates and learns from pseudo labels. Considering the lexical similarity and syntactic difference between sign language and spoken language, our S 3 LG adopts both the rule-based heuristic and modelbased approach for auto-annotation. During training, we randomly mix these complementary synthetic datasets and mark their differences with a special token. As the synthetic data may be less quality, the S 3 LG further leverages consistency regularization to reduce the negative impact of noise in the synthetic data. Extensive experiments are conducted on public benchmarks to demonstrate the effectiveness of the S 3 LG. Our code is available at https://github.com/yaohj11/S3LG.

For agents

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

get_harvested_code_for_paper("2406.08173")
get_code_for_paper("2406.08173")
have("2406.08173")

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

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

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

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

Connect an agent — have() is free.