SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.16953 · 2022

Improving Bilingual Lexicon Induction with Cross-Encoder Reranking

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 (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; 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/2210.16953.json · badge: /api/ran/2210.16953.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
cambridgeltl/BLICEr canonical (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
FunctionStatusWhere it lives
getknn_csls_test Ran
ran on a synthesized input
cambridgeltl/BLICEr/evaluate_ce.py
code served (permissive licence) · get_code("27cf45816a6bce78")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 math

torch.manual_seed(0)

# Create small tensors for source and target embeddings
# src_ and tgt_ are embedding matrices that will be normalized
src_ = torch.randn(2, 4)  # 2 source vectors, 4 dimensions
tgt_ = torch.randn(3, 4)  # 3 target vectors, 4 dimensions

# src_ids and tgt_ids are indices for the source and target hubness vectors
src_ids = torch.tensor([0, 1])  # 2 source ids
tgt_ids = torch.tensor([0, 1])  # 2 target ids (ground truth matches)

# Hubness vectors - one value per embedding
src_hubness_ = torch.randn(2)  # hubness for 2 source embeddings
tgt_hubness_ = torch.randn(3)  # hubness for 3 target embeddings

# lexicon_size is the total vocabulary size for accuracy calculation
lexicon_size = 2

# k is the number of nearest neighbors to retrieve
k = 2

# bsz is the batch size
bsz = 1

# t is a temperature/weighting parameter
t = 1.0

ARGS = {
    "src_": src_,
    "tgt_": tgt_,
    "src_ids": src_ids,
    "tgt_ids": tgt_ids,
    "src_hubness_": src_hubness_,
    "tgt_hubness_": tgt_hubness_,
    "lexicon_size": lexicon_size,
    "k": k,
    "bsz": bsz,
    "t": t,
}
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 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
getknn_test Ran
ran on a synthesized input
cambridgeltl/BLICEr/evaluate_ce.py
code served (permissive licence) · get_code("6957715d8fa5b3ce")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 math

torch.manual_seed(0)

# Create small embeddings
# src_ and tgt_ are embedding tensors that will be normalized
# Using distinct dimensions: 2 source embeddings, 3 target embeddings, 4-dim vectors
src_ = torch.randn(2, 4)
tgt_ = torch.randn(3, 4)

# src_ids: IDs for source embeddings (used implicitly, not in function body actually)
src_ids = [0, 1]

# tgt_ids: IDs for target embeddings, used to check if top-1 match is correct
# lexicon_size determines accuracy calculation
tgt_ids = [1, 0]  # Ground truth: src 0 should match tgt 1, src 1 should match tgt 0

lexicon_size = 2

ARGS = {
    "src_": src_,
    "tgt_": tgt_,
    "src_ids": src_ids,
    "tgt_ids": tgt_ids,
    "lexicon_size": lexicon_size,
    "k": 2,
    "bsz": 1024
}
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 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
lexicon_dict2list Ran
ran on a synthesized input
cambridgeltl/BLICEr/evaluate_ce.py
code served (permissive licence) · get_code("add2302ce4389e86")
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 2, 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

def lexicon_dict2list(lexicon_dict):
    res_src = []
    res_tgt = []
    for key in lexicon_dict.keys():
        for value in lexicon_dict[key]:
            res_src.append(key)
            res_tgt.append(value)
    return (res_src, res_tgt)

# Construct valid arguments for lexicon_dict2list
# The function expects a dictionary where keys map to iterables of values
lexicon_dict_example = {
    "hello": ["bonjour", "salut"],
    "world": ["monde"],
    "cat": ["chat", "félin", "minou"]
}

ARGS = {
    "lexicon_dict": lexicon_dict_example
}
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 tuple, ndim 2, 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
load_embs Ran
ran on a synthesized input
cambridgeltl/BLICEr/utils.py
code served (permissive licence) · get_code("f1572a727a130821")
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 codecs
import numpy as np
import tempfile
import os

# Create a temporary embeddings file
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "embeddings.txt")

# Write a simple embeddings file
with codecs.open(temp_file, encoding='utf8', mode='w') as f:
    f.write("5 3\n")  # 5 vectors, 3 dimensions
    f.write("word1 0.1 0.2 0.3\n")
    f.write("word2 0.4 0.5 0.6\n")
    f.write("word3 0.7 0.8 0.9\n")
    f.write("word4 1.0 1.1 1.2\n")
    f.write("word5 1.3 1.4 1.5\n")

ARGS = {
    "path": temp_file,
    "topk": None,
    "dimension": None
}
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

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-23.

Repositories linked to this paper

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

Abstract

Bilingual lexicon induction (BLI) with limited bilingual supervision is a crucial yet challenging task in multilingual NLP. Current state-of-the-art BLI methods rely on the induction of cross-lingual word embeddings (CLWEs) to capture cross-lingual word similarities; such CLWEs are obtained 1) via traditional static models (e.g., VecMap), or 2) by extracting type-level CLWEs from multilingual pretrained language models (mPLMs), or 3) through combining the former two options. In this work, we propose a novel semi-supervised post-hoc reranking method termed BLICEr (BLI with Cross-Encoder Reranking), applicable to any precalculated CLWE space, which improves their BLI capability. The key idea is to 'extract' cross-lingual lexical knowledge from mPLMs, and then combine it with the original CLWEs. This crucial step is done via 1) creating a word similarity dataset, comprising positive word pairs (i.e., true translations) and hard negative pairs induced from the original CLWE space, and then 2) fine-tuning an mPLM (e.g., mBERT or XLM-R) in a cross-encoder manner to predict the similarity scores. At inference, we 3) combine the similarity score from the original CLWE space with the score from the BLI-tuned cross-encoder. BLICEr establishes new state-of-the-art results on two standard BLI benchmarks spanning a wide spectrum of diverse languages: it substantially outperforms a series of strong baselines across the board. We also validate the robustness of BLICEr with different CLWEs.

For agents

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

get_harvested_code_for_paper("2210.16953")
get_code_for_paper("2210.16953")
have("2210.16953")

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

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

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

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

Connect an agent — have() is free.