SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.14118 · ACL · 2020

Analysing Lexical Semantic Change with Contextualised Word Representations

Mario Giulianelli, Marco Tredici, Raquel Fernández

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 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; 0 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/2004.14118.json · badge: /api/ran/2004.14118.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
glnmario/cwr4lsc marked official in Papers with Code
Papers with Code archive
4 ran · 0 no recorded run
FunctionStatusWhere it lives
GMM Ran
ran on a synthesized input · constructed an object; no result was computed
glnmario/cwr4lsc/clustering.py
code served (permissive licence) · get_code("92190beeea592eec")
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, GMM: 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
from sklearn.mixture import GaussianMixture

# Create a small dataset
np.random.seed(0)
X = np.random.randn(10, 4)

# Create a fitted GaussianMixture model with 2 components
model = GaussianMixture(n_components=2, random_state=0)
model.fit(X)

# Define arguments for GMM class
ARGS = {
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GMM — 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 GMM 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
best_gmm Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
glnmario/cwr4lsc/clustering.py
code served (permissive licence) · get_code("e6806e44ab71669f")
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 numpy as np
from collections import defaultdict
from sklearn.mixture import GaussianMixture

class GMM(object):
    """
    A Gaussian Mixture Model object, with its number of components, AIC and BIC scores.
    """

    def __init__(self, model=None):
        self.model = model
        if self.model:
            self.k = self.model.weights_.shape[0]
            self.covariance = self.model.covariance_type
        else:
            self.k = 0
            self.covariance = None

    def aic(self, X):
        if self.model:
            return self.model.aic(X)
        else:
            return float('inf')

    def bic(self, X):
        if self.model:
            return self.model.bic(X)
        else:
            return float('inf')

SEED = 42

def best_gmm(X, max_range=np.arange(2, 11), covariance_types=None, max_iter=1000, n_init=5, seed=SEED):
    """
    Return the best Gaussian Mixture Model given the data, a range of K values, and two K selection criteria.

    :param X: usage matrix (made of usage vectors)
    :param max_range: range within the number of clusters should lie
    :param covariance_types: a list containing any subset of this list:
    :param max_iter: maximum number of EM iterations
    :param n_init: number of EM runs
    :param seed: random seed
    :return: best GMM according to Akaike Information Criterion, Bayesian Information Criterion,
             and the respective AIC and BIC scores
    """
    if covariance_types is None:
        covariance_types = ['full', 'spherical', 'tied', 'diag']
    if not isinstance(covariance_types, (list,)):
        covariance_types = [covariance_types]
    aics = defaultdict(list)
    bics = defaultdict(list)
    best_gmm_aic = GMM()
    best_gmm_bic = GMM()
    for i, cov in enumerate(covariance_types):
        for k in max_range:
            m = GaussianMixture(n_components=k, covariance_type=cov, max_iter=max_iter, n_init=n_init, random_state=seed).fit(X)
            if m.aic(X) < best_gmm_aic.aic(X):
                best_gmm_aic = GMM(m)
            if m.bic(X) < best_gmm_bic.bic(X):
                best_gmm_bic = GMM(m)
            bics[cov].append(m.bic(X))
            aics[cov].append(m.aic(X))
    return (best_gmm_aic, best_gmm_bic, bics, aics)


np.random.seed(SEED)
X = np.random.randn(10, 4)

ARGS = {
    'X': X,
    'max_range': np.arange(2, 5),
    'covariance_types': ['full', 'spherical'],
    'max_iter': 100,
    'n_init': 2,
    'seed': SEED
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
best_kmeans Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
glnmario/cwr4lsc/clustering.py
code served (permissive licence) · get_code("1ee54a0e51df2702")
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 numpy as np
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score, calinski_harabasz_score

# Create a small usage matrix with 10 samples and 4 features
np.random.seed(42)
X = np.random.randn(10, 4)

# Define the range of k values to test
max_range = np.arange(2, 6)

# Define the criterion
criterion = 'silhouette'

ARGS = {
    'X': X,
    'max_range': max_range,
    'criterion': criterion
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
cluster_usages Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
glnmario/cwr4lsc/clustering.py
code served (permissive licence) · get_code("d2f6c9c92392f97f")
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 KMeans. 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
from sklearn import preprocessing
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score, calinski_harabasz_score
from sklearn.mixture import GaussianMixture

# Create a small usage matrix with distinct dimensions
# 8 samples, 5 features
np.random.seed(42)
Uw = np.random.randn(8, 5)

ARGS = {
    'Uw': Uw,
    'method': 'kmeans',
    'k_range': np.arange(2, 5),
    'criterion': 'silhouette'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type KMeans — a KMeans output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a KMeans 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

Also present in other papers' code

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

This paper presents the first unsupervised approach to lexical semantic change that makes use of contextualised word representations. We propose a novel method that exploits the BERT neural language model to obtain representations of word usages, clusters these representations into usage types, and measures change along time with three proposed metrics. We create a new evaluation dataset and show that the model representations and the detected semantic shifts are positively correlated with human judgements. Our extensive qualitative analysis demonstrates that our method captures a variety of synchronic and diachronic linguistic phenomena. We expect our work to inspire further research in this direction.

For agents

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

get_harvested_code_for_paper("2004.14118")
get_code_for_paper("2004.14118")
have("2004.14118")

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

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

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

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

Connect an agent — have() is free.