SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1310.4546 · NeurIPS · 2013

Distributed Representations of Words and Phrases and their Compositionality

Kai Chen, Tomas Mikolov, Jeffrey Dean, Greg Corrado

arXiv · PDF · Open in the Atlas

Code that ran

21 of 26 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 20 have no contract verdict; 1 failure of our instrument; 5 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/1310.4546.json · badge: /api/ran/1310.4546.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
JoegameZhou/ms-skipgram community (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
ye-kyaw-thu/myword community (classifier label)
classifier basis not recorded on the link
6 ran · 3 no recorded run
dhyeon/ingredient-vectors community
Papers with Code archive
1 ran · 0 no recorded run
Robotmurlock/Deepwalk-and-Node2vec community
Papers with Code archive
1 ran · 0 no recorded run
jakubmonhart/package2vec community
Papers with Code archive
1 ran · 0 no recorded run
theeluwin/pytorch-sgns community
not in the paper's declared repositories
1 ran · 0 no recorded run
mari756h/The_unemployed_cells community
Papers with Code archive
1 ran · 0 no recorded run
ghlee0304/NLP-with-tensorflow-pytorch community
Papers with Code archive
1 ran · 0 no recorded run
kefirski/contiguous-succotash community
Papers with Code archive
0 ran · 1 no recorded run
arvind385801/paraphrasegen community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
NegativeSampling Ran
ran on a synthesized input
dhyeon/ingredient-vectors/paragraphvec/loss.py
code served (permissive licence) · get_code("ee196ccdb50aa8d4")
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 0, 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

class NegativeSampling(nn.Module):
    """Negative sampling loss as proposed by T. Mikolov et al. in Distributed
    Representations of Words and Phrases and their Compositionality.
    """

    def __init__(self):
        super(NegativeSampling, self).__init__()
        self._log_sigmoid = nn.LogSigmoid()

    def forward(self, scores):
        """Computes the value of the loss function.

        Parameters
        ----------
        scores: autograd.Variable of size (batch_size, num_noise_words + 1)
            Sparse unnormalized log probabilities. The first element in each
            row is the ground truth score (i.e. the target), other elements
            are scores of samples from the noise distribution.
        """
        k = scores.size()[1] - 1
        return -torch.sum(self._log_sigmoid(scores[:, 0]) + torch.sum(self._log_sigmoid(-scores[:, 1:]), dim=1) / k) / scores.size()[0]


INIT_ARGS = {}

ARGS = {
    'scores': torch.randn(2, 5)
}

if __name__ == '__main__':
    model = NegativeSampling(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output: {output}")
    print(f"Output shape: {output.shape}")
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 0, 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)
NegativeSamplingLoss Ran
ran on a synthesized input
Robotmurlock/Deepwalk-and-Node2vec/shallow_encoders/word2vec/loss.py
code served (permissive licence) · get_code("68673c54be60cb7a")
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 torch
import numpy as np

# NegativeSamplingLoss has no __init__ parameters (inherits from nn.Module with no custom init)
INIT_ARGS = {}

# The forward method takes positive_logits and negative_logits
# positive_logits: shape (batch_size,) - logits for positive samples
# negative_logits: shape (batch_size, num_negative_samples) - logits for negative samples

batch_size = 2
num_negative_samples = 5

positive_logits = torch.randn(batch_size)
negative_logits = torch.randn(batch_size, num_negative_samples)

ARGS = {
    'positive_logits': positive_logits,
    'negative_logits': negative_logits
}
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 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)
Package2Vec Ran
ran on a synthesized input · constructed an object; no result was computed
jakubmonhart/package2vec/package2vec/models/skipgram.py
pointer only (licence: NONE) · get_code("a8b2c31deeac8d60")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jakubmonhart/package2vec 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.

SGNS Ran
ran on a synthesized input · constructed an object; no result was computed
theeluwin/pytorch-sgns/model.py
code served (permissive licence) · get_code("5cc7c56f3b830619")
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 an instance of its own class, SGNS: the run constructed the object and did not call it, so no result was computed. 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 numpy as np
import torch as t
import torch.nn as nn
from torch import FloatTensor as FT

t.manual_seed(0)

# Create a minimal embedding module that implements the methods called in SGNS.forward
class MinimalEmbedding(nn.Module):
    def __init__(self, vocab_size, embedding_dim):
        super(MinimalEmbedding, self).__init__()
        self.embedding_i = nn.Embedding(vocab_size, embedding_dim)
        self.embedding_o = nn.Embedding(vocab_size, embedding_dim)
    
    def forward_i(self, iword):
        return self.embedding_i(iword)
    
    def forward_o(self, owords):
        return self.embedding_o(owords)

# Parameters
vocab_size = 20000
embedding_dim = 4
batch_size = 2
context_size = 3
n_negs = 20

# Create embedding module
embedding = MinimalEmbedding(vocab_size, embedding_dim)

# Create weights for negative sampling (optional)
weights = np.random.rand(vocab_size)

ARGS = {
    'embedding': embedding,
    'vocab_size': vocab_size,
    'n_negs': n_negs,
    'weights': weights
}
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 SGNS — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SGNS 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
SkipGram Ran
ran on a synthesized input
mari756h/The_unemployed_cells/model/skipgram.py
pointer only (licence: NONE) · get_code("d62db1c3d14660cc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, mari756h/The_unemployed_cells 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.

build_dataset Ran
ran; our contract draft was wrong, not the code
ghlee0304/NLP-with-tensorflow-pytorch/basic_Skip-gram/basic_skip_gram_v2.py
pointer only (licence: NONE) · get_code("0091c377268c395c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ghlee0304/NLP-with-tensorflow-pytorch 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.

cal_top_k_similar Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/src/utils.py
code served (permissive licence) · get_code("96f3d77198b59301")
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 2, dtype family int, shape (2, 2) 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

# Set up target embeddings: 2 target vectors of dimension 4
target_embs = np.array([
    [1.0, 0.5, 0.2, 0.1],
    [0.3, 0.8, 0.1, 0.6]
], dtype=np.float32)

# Set up embedding matrix: 5 vocabulary embeddings of dimension 4
emb_matrix = np.array([
    [1.0, 0.5, 0.2, 0.1],
    [0.9, 0.4, 0.3, 0.2],
    [0.2, 0.8, 0.1, 0.7],
    [0.1, 0.1, 0.9, 0.2],
    [0.5, 0.5, 0.5, 0.5]
], dtype=np.float32)

ARGS = {
    "target_embs": target_embs,
    "emb_matrix": emb_matrix,
    "k": 2
}
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 2, dtype family int, shape (2, 2) — shape (2, 2) 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
cal_top_k_similar Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/infer/sdk/infer_eval.py
code served (permissive licence) · get_code("b18de39f876c54e1")
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 2, dtype family int, shape (2, 2) 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

# Create small embedding matrices
# target_embs_: shape (2, 4) - 2 target embeddings of dimension 4
target_embs_ = np.array([
    [1.0, 0.5, 0.2, 0.1],
    [0.3, 0.8, 0.4, 0.6]
], dtype=np.float32)

# emb_matrix_: shape (3, 4) - 3 embeddings in the vocabulary of dimension 4
emb_matrix_ = np.array([
    [1.0, 0.5, 0.2, 0.1],
    [0.2, 0.3, 0.9, 0.4],
    [0.5, 0.5, 0.5, 0.5]
], dtype=np.float32)

# ks: number of top similar items to return
ks = 2

ARGS = {
    "target_embs_": target_embs_,
    "emb_matrix_": emb_matrix_,
    "ks": ks
}
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 2, dtype family int, shape (2, 2) — shape (2, 2) 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
collocate Ran
ran on a synthesized input
ye-kyaw-thu/myword/phrase_segment.py
code served (permissive licence) · get_code("e24fdf3aaf9640bd")
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 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 torch

torch.manual_seed(0)

# Construct arguments for collocate function
words = ["hello", "world", "hello", "there"]

phrases = {
    ("hello", "world"): 2,
    ("hello", "there"): 1,
}

ARGS = {
    "words": words,
    "phrases": phrases,
}
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 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
connect Ran
ran on a synthesized input
ye-kyaw-thu/myword/phrase_segment.py
code served (permissive licence) · get_code("a7a2edb4fd00832a")
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 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 torch
import numpy as np

torch.manual_seed(0)

words = ["hello", "world", "foo", "bar"]
bond = [0, 1, 0, 0]

ARGS = {
    "words": words,
    "bond": bond
}
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 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
count_bigram Ran
ran on a synthesized input
ye-kyaw-thu/myword/word_dict.py
code served (permissive licence) · get_code("824bdbca97ab85ac")
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 defaultdict. 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

# Create temporary files for the function to write to
temp_dir = tempfile.mkdtemp()
input_file = os.path.join(temp_dir, "input.txt")
bigram_dict_txt = os.path.join(temp_dir, "bigram.txt")
bigram_dict_bin = os.path.join(temp_dir, "bigram.pkl")

# Create a sample input file with some text
with open(input_file, 'w') as f:
    f.write("hello world hello there\n")
    f.write("world hello there friend\n")
    f.write("friend hello world\n")

ARGS = {
    "file": input_file,
    "bigram_dict_txt": bigram_dict_txt,
    "bigram_dict_bin": bigram_dict_bin,
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
count_unigram Ran
ran on a synthesized input
ye-kyaw-thu/myword/word_dict.py
code served (permissive licence) · get_code("7f2b845cf5a80fb2")
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 defaultdict. 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

# Create temporary files for the function to write to
temp_dir = tempfile.mkdtemp()
input_file = os.path.join(temp_dir, "input.txt")
unigram_dict_txt = os.path.join(temp_dir, "unigram.txt")
unigram_dict_bin = os.path.join(temp_dir, "unigram.pkl")

# Create a sample input file with some text
with open(input_file, 'w') as f:
    f.write("hello world hello\n")
    f.write("world python python\n")
    f.write("test hello\n")

ARGS = {
    "file": input_file,
    "unigram_dict_txt": unigram_dict_txt,
    "unigram_dict_bin": unigram_dict_bin,
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
del_useless_char Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/src/dataset.py
code served (permissive licence) · get_code("bf1cb4c0bd8e3133")
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 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 re

def del_useless_char(corpus):
    """Remove useless character in corpus.

    Args:
        corpus: str.
    Returns:
        list of str words.
    """
    corpus = corpus.strip().lower()
    rule = re.compile('[^a-z^A-Z]')
    corpus = rule.sub(' ', corpus)
    corpus = corpus.split()
    return corpus

ARGS = {
    "corpus": "Hello World! This is a Test123 with Special@Characters#"
}
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 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
exp_decay_lr Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/src/lr_scheduler.py
code served (permissive licence) · get_code("51e3b40a111cf6a8")
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 (100,) 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

ARGS = {
    'learning_rate': 0.1,
    'decay_rate': 0.96,
    'decay_step': 10,
    'total_step': 100,
    'is_stair': False
}
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 (100,) — shape (100,) 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_corpus Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/src/dataset.py
code served (permissive licence) · get_code("10fdaadaf6b04bd0")
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 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 os
import tempfile
import shutil

# Create a temporary directory with test files
temp_dir = tempfile.mkdtemp()

# Create test files with sample text
test_file_1 = os.path.join(temp_dir, "test1.txt")
with open(test_file_1, 'w') as f:
    f.write("Hello World! This is a test.\n")

test_file_2 = os.path.join(temp_dir, "test2.txt")
with open(test_file_2, 'w') as f:
    f.write("Another sample text with numbers 123 and special chars @#$.\n")

# Define ARGS
ARGS = {
    "data_dir": temp_dir
}
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 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_count_freq Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/src/dataset.py
code served (permissive licence) · get_code("4320e8a70f2286f6")
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 collections

def get_count_freq(corpus):
    """Construct dictionaries about words and count.

    Args:
        corpus: list of str words.
    Returns:
        list of (word, count) pairs, dictionary that maps word to its frequency.
    """
    word_count = collections.Counter(corpus)
    word_count = sorted(word_count.items(), key=lambda x: x[1], reverse=True)
    word_sum = sum([item[1] for item in word_count])
    word2freq = dict()
    for w, c in word_count:
        word2freq[w] = c / word_sum
    return (word_count, word2freq)


# Setup code
corpus = ["hello", "world", "hello", "foo", "bar", "hello", "world"]

ARGS = {
    "corpus": corpus
}
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 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
get_w2v_emb Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/src/utils.py
code served (permissive licence) · get_code("5e2fb5cfe9f6bdef")
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
from unittest.mock import Mock

torch.manual_seed(0)

# Create a mock net object with c_emb that has get_parameters() method
mock_net = Mock()

# Create mock embedding object
mock_c_emb = Mock()

# Create a mock parameter (numpy array)
# Use embedding dimension of 4, vocabulary size of 2
emb_matrix = np.random.randn(2, 4).astype(np.float32)

# Create a mock parameter object that has asnumpy() method
mock_param = Mock()
mock_param.asnumpy.return_value = emb_matrix

# Set up the mock to return parameters
mock_c_emb.get_parameters.return_value = [mock_param]

# Attach c_emb to net
mock_net.c_emb = mock_c_emb

# Create id2word dictionary mapping word ids to words
id2word = {0: "hello", 1: "world"}

ARGS = {
    "net": mock_net,
    "id2word": id2word
}
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
load_eval_data Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/infer/sdk/infer_eval.py
code served (permissive licence) · get_code("a17c8357ae091ec8")
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 os
import tempfile
import shutil

# Create a temporary directory with sample data files
temp_dir = tempfile.mkdtemp()

# Create a sample questions-words.txt file with the expected format
sample_file = os.path.join(temp_dir, "questions-words.txt")
with open(sample_file, 'w') as f:
    f.write(": capital-common-countries\n")
    f.write("athens greece baghdad iraq\n")
    f.write("bangkok thailand beijing china\n")
    f.write(": capital-world\n")
    f.write("abuja nigeria algiers algeria\n")
    f.write("amman jordan ankara turkey\n")

ARGS = {
    "data_dir": temp_dir
}
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 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
parse_write Ran
ran on a synthesized input
ye-kyaw-thu/myword/phrase_segment.py
code served (permissive licence) · get_code("6c88f6b553429c66")
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 tempfile
import os

# Create temporary files for input and output
temp_dir = tempfile.mkdtemp()
input_file = os.path.join(temp_dir, 'input.txt')
output_file = os.path.join(temp_dir, 'output.txt')

# Write sample input data
with open(input_file, 'w') as f:
    f.write('the quick brown fox\n')
    f.write('hello world test\n')
    f.write('\n')
    f.write('another sentence here\n')

# Create phrases dictionary
# phrases maps (word1, word2) tuples to bond strength values
phrases = {
    ('the', 'quick'): 5,
    ('quick', 'brown'): 3,
    ('hello', 'world'): 7,
}

ARGS = {
    'file': input_file,
    'phrases': phrases,
    'output': output_file,
}
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
poly_decay_lr Ran
ran on a synthesized input
JoegameZhou/ms-skipgram/src/lr_scheduler.py
code served (permissive licence) · get_code("a82c201f7ce6060b")
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 (250,) 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

# Define all arguments for poly_decay_lr
ARGS = {
    "learning_rate": 0.1,
    "end_learning_rate": 0.01,
    "decay_step": 100,
    "total_step": 250,
    "power": 2.0,
    "update_decay_step": False,
}
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 (250,) — shape (250,) 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
read_dict Ran
ran on a synthesized input
ye-kyaw-thu/myword/word_segment.py
code served (permissive licence) · get_code("d201a649d6027a96")
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 pickle
import tempfile
import os

# Create a temporary pickle file with a valid dictionary
temp_dict = {'key1': 'value1', 'key2': 42, 'key3': [1, 2, 3]}
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.pkl')
temp_file_path = temp_file.name
temp_file.close()

with open(temp_file_path, 'wb') as f:
    pickle.dump(temp_dict, f)

ARGS = {
    'fileDICT': temp_file_path
}
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 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
NEG_loss Not yet run
unverified (harvested, no recorded run)
kefirski/contiguous-succotash/selfModules/neg.py
code served (permissive licence) · get_code("54a2b02dd10c6f7d")
How it ran

no invocation recorded.

NEG_loss Not yet run
unverified (harvested, no recorded run)
arvind385801/paraphrasegen/selfModules/neg.py
pointer only (licence: NONE) · get_code("dd07fd3c27358000")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, arvind385801/paraphrasegen 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. No invocation recorded.

conditionalProb Not yet run
unverified (harvested, no recorded run)
ye-kyaw-thu/myword/word_segment.py
code served (permissive licence) · get_code("6c84b835c7f97d8e")
How it ran

no invocation recorded.

syllable Not yet run
unverified (harvested, no recorded run)
ye-kyaw-thu/myword/syl_segment.py
code served (permissive licence) · get_code("79c5f650d068d183")
How it ran

no invocation recorded.

viterbi Not yet run
unverified (harvested, no recorded run)
ye-kyaw-thu/myword/word_segment.py
code served (permissive licence) · get_code("813f13c070e7eea5")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

The recently introduced continuous Skip-gram model is an efficient method for learning high-quality distributed vector representations that capture a large number of precise syntactic and semantic word relationships. In this paper we present several extensions that improve both the quality of the vectors and the training speed. By subsampling of the frequent words we obtain significant speedup and also learn more regular word representations. We also describe a simple alternative to the hierarchical softmax called negative sampling. An inherent limitation of word representations is their indifference to word order and their inability to represent idiomatic phrases. For example, the meanings of "Canada" and "Air" cannot be easily combined to obtain "Air Canada". Motivated by this example, we present a simple method for finding phrases in text, and show that learning good vector representations for millions of phrases is possible.

For agents

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

get_harvested_code_for_paper("1310.4546")
get_code_for_paper("1310.4546")
have("1310.4546")

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

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

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

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

Connect an agent — have() is free.