SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2022.findings-emnlp.341 · EMNLP Findings · 2022

Joint Multilingual Knowledge Graph Completion and Alignment

Mathias Niepert, Dat Nguyen, Quoc Viet, Hung Nguyen, Vinh Tong, Tam Nguyen, Trung Huynh

Open in the Atlas

Code that ran

9 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 7 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2022.findings-emnlp.341.json · badge: /api/ran/2022.findings-emnlp.341.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
vinhsuhi/JMAC canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
arg_sort Ran
ran on a synthesized input
vinhsuhi/JMAC/JMAC_DBPv1/modules/finding/alignment.py
code served (permissive licence) · get_code("ed521c9dbf68a29a")
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)

# Analyze the function:
# - idx: indexed with range(len(idx)), so needs to be a sequence/list/array
# - sim_mat: indexed with sim_mat[i, :], so needs to be 2D array-like with argsort()
# - prefix1, prefix2: concatenated with str(idx[i]) and str(r), so strings
# - The function creates a dict with keys from prefix1 + str(idx[i])
# - Values are lists of strings from prefix2 + str(r) where r comes from argsort()

# Create idx as a list of integers
idx = [0, 1]

# Create sim_mat as a 2D array (2x3 to have distinct dimensions)
# Using numpy array that supports indexing and argsort
sim_mat = np.array([
    [0.9, 0.7, 0.5],
    [0.6, 0.8, 0.4]
], dtype=np.float32)

# Create string prefixes
prefix1 = "query_"
prefix2 = "result_"

ARGS = {
    "idx": idx,
    "sim_mat": sim_mat,
    "prefix1": prefix1,
    "prefix2": prefix2
}
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
calculate_nearest_k Ran
ran on a synthesized input
vinhsuhi/JMAC/JMAC_DBPv1/modules/finding/similarity.py
code served (permissive licence) · get_code("6896724f01cd082f")
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 (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 a small similarity matrix
# Shape: (2, 4) - 2 samples, 4 features
sim_mat = np.array([
    [0.9, 0.7, 0.5, 0.3],
    [0.8, 0.6, 0.4, 0.2]
], dtype=np.float32)

# Set k to 2 (find 2 nearest neighbors)
k = 2

ARGS = {
    "sim_mat": sim_mat,
    "k": k
}
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 (2,) — shape (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
calculate_rank Ran
ran on a synthesized input
vinhsuhi/JMAC/JMAC_DBPv1/modules/finding/alignment.py
code served (permissive licence) · get_code("03f5e243abc71b91")
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

# Create small test data
np.random.seed(0)

# idx: list of true target indices
# This should be indices that exist in the similarity matrix
idx = np.array([0, 1])

# sim_mat: similarity matrix of shape (len(idx), total_num)
# Values should be such that we can find the gold index in the rankings
# Shape: (2, 5) - 2 queries, 5 candidates
sim_mat = np.array([
    [0.9, 0.7, 0.5, 0.3, 0.1],  # query 0, gold is index 0
    [0.2, 0.8, 0.4, 0.6, 0.1],  # query 1, gold is index 1
], dtype=np.float32)

# top_k: list of k values to evaluate
# Must include 1 as per assertion in the function
top_k = [1, 3, 5]

# accurate: boolean flag for sorting method
accurate = True

# total_num: total number of items being evaluated
total_num = 2

ARGS = {
    "idx": idx,
    "sim_mat": sim_mat,
    "top_k": top_k,
    "accurate": accurate,
    "total_num": total_num,
}
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
early_stop Ran
ran on a synthesized input
vinhsuhi/JMAC/JMAC_DBPv1/modules/finding/evaluation.py
code served (permissive licence) · get_code("b32b2a8166f0f160")
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 int; 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 logging

# Set up a minimal logger
logger = logging.getLogger('test_logger')
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
logger.addHandler(handler)

# Define arguments for early_stop function
# The function compares flag1, flag2, and flag in the condition: flag <= flag2 <= flag1
# It calls logger.info() and returns a tuple
flag1 = 10
flag2 = 5
flag = 3
ARGS = {
    'flag1': flag1,
    'flag2': flag2,
    'flag': flag,
    'logger': logger
}
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, ndim 1, dtype family int — 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
get_combined_results Ran
ran; our contract draft was wrong, not the code
vinhsuhi/JMAC/JMAC_DBPv1/modules/helper/helper.py
code served (permissive licence) · get_code("1693e0374b56cfbc")
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 left_results dict with required keys
left_results = {
    'count': 100,
    'mr': 50.0,
    'mrr': 75.0,
    'hits@1': 80,
    'hits@2': 85,
    'hits@3': 88,
    'hits@4': 90,
    'hits@5': 92,
    'hits@6': 93,
    'hits@7': 94,
    'hits@8': 95,
    'hits@9': 96,
    'hits@10': 97,
}

# Construct right_results dict with required keys
right_results = {
    'count': 100,
    'mr': 60.0,
    'mrr': 70.0,
    'hits@1': 75,
    'hits@2': 80,
    'hits@3': 82,
    'hits@4': 85,
    'hits@5': 87,
    'hits@6': 88,
    'hits@7': 89,
    'hits@8': 90,
    'hits@9': 91,
    'hits@10': 92,
}

ARGS = {
    'left_results': left_results,
    'right_results': right_results,
}
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
get_logger Ran
ran; our contract draft was wrong, not the code
vinhsuhi/JMAC/JMAC_DBPv1/modules/helper/helper.py
code served (permissive licence) · get_code("4ecef8549fab0398")
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 Logger. 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 json
import os

# Create temporary directories for testing
temp_dir = tempfile.mkdtemp()
log_dir = temp_dir + '/logs/'
config_dir = temp_dir + '/config/'

# Create directories
os.makedirs(log_dir, exist_ok=True)
os.makedirs(config_dir, exist_ok=True)

# Create a minimal log_config.json that the function expects
log_config = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'standard': {
            'format': '%(asctime)s - [%(levelname)s] - %(message)s'
        }
    },
    'handlers': {
        'file_handler': {
            'class': 'logging.FileHandler',
            'level': 'DEBUG',
            'formatter': 'standard',
            'filename': ''
        },
        'console': {
            'class': 'logging.StreamHandler',
            'level': 'DEBUG',
            'formatter': 'standard',
            'stream': 'ext://sys.stdout'
        }
    },
    'root': {
        'level': 'DEBUG',
        'handlers': ['file_handler', 'console']
    }
}

# Write the config file
with open(config_dir + 'log_config.json', 'w') as f:
    json.dump(log_config, f)

# Define arguments for the function
ARGS = {
    'name': 'test_logger',
    'log_dir': log_dir,
    'config_dir': config_dir
}
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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
get_param Ran
ran on a synthesized input
vinhsuhi/JMAC/JMAC_DBPv1/modules/helper/helper.py
code served (permissive licence) · get_code("3e25584b85b42780")
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 Parameter, 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
from torch.nn import Parameter

torch.manual_seed(0)

# Test case 1: with init parameter provided
init_tensor = torch.randn(3, 4)

# Test case 2: with shape only (no init)
shape_tuple = (5, 6)

# We need to provide both cases, so let's use the first one as the primary test
ARGS = {
    "shape": (3, 4),
    "init": None
}
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 Parameter, ndim 2, dtype family float — no output shape is stated: observe_signature.py recorded Tensor ndim 2, which disagrees with the fixture run
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
parse_triples Ran
ran on a synthesized input
vinhsuhi/JMAC/JMAC_DBPv1/modules/load/kg.py
code served (permissive licence) · get_code("95f09f6661fa6d49")
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

torch.manual_seed(0)

# parse_triples expects a list of tuples where each tuple is (subject, predicate, object)
# The function iterates through these triples and adds each component to sets
triples = [
    ("alice", "knows", "bob"),
    ("bob", "likes", "charlie"),
    ("alice", "knows", "charlie"),
    ("charlie", "works_with", "alice"),
]

ARGS = {
    "triples": triples
}
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 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
sim Ran
ran on a synthesized input
vinhsuhi/JMAC/JMAC_DBPv1/modules/finding/similarity.py
code served (permissive licence) · get_code("b9d38f87140da325")
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 float, shape (2, 3) 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
from scipy.spatial.distance import cdist
from sklearn import preprocessing
from sklearn.metrics.pairwise import euclidean_distances

np.random.seed(0)

# Create small embedding matrices with distinct dimensions
# embed1: 2 embeddings of dimension 4
embed1 = np.random.randn(2, 4).astype(np.float32)

# embed2: 3 embeddings of dimension 4
embed2 = np.random.randn(3, 4).astype(np.float32)

ARGS = {
    'embed1': embed1,
    'embed2': embed2,
    'metric': 'inner',
    'normalize': False,
    'csls_k': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — 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 float, shape (2, 3) — shape (2, 3) 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
csls_sim Not yet run
unverified (harvested, no recorded run)
vinhsuhi/JMAC/JMAC_DBPv1/modules/finding/similarity.py
code served (permissive licence) · get_code("89e2988134275ac7")
How it ran

no invocation 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, 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 8 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
get_logger 3 other papers
3 dated earlier
1901.08255 (2019-01)
Confidence-based Graph Convolutional Networks for Semi-Supervised Learning
1911.00219 (2019-11)
InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions
1911.03082 (2019-11)
Composition-based Multi-Relational Graph Convolutional Networks
get_combined_results 2 other papers
2 dated earlier
1911.00219 (2019-11)
InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions
1911.03082 (2019-11)
Composition-based Multi-Relational Graph Convolutional Networks

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

Repositories linked to this paper

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

Abstract

Knowledge graph (KG) alignment and completion are usually treated as two independent tasks. While recent work has leveraged entity and relation alignments from multiple KGs, such as alignments between multilingual KGs with common entities and relations, a deeper understanding of the ways in which multilingual KG completion (MKGC) can aid the creation of multilingual KG alignments (MKGA) is still limited. Motivated by the observation that structural inconsistencies -the main challenge for MKGA models -can be mitigated through KG completion methods, we propose a novel model for jointly completing and aligning knowledge graphs. The proposed model combines two components that jointly accomplish KG completion and alignment. These two components employ relation-aware graph neural networks that we propose to encode multihop neighborhood structures into entity and relation representations. Moreover, we also propose (i) a structural inconsistency reduction mechanism to incorporate information from the completion into the alignment component, and (ii) an alignment seed enlargement and triple transferring mechanism to enlarge alignment seeds and transfer triples during KGs alignment. Extensive experiments on a public multilingual benchmark show that our proposed model outperforms existing competitive baselines, obtaining new state-of-the-art results on both MKGC and MKGA tasks.

For agents

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

get_harvested_code_for_paper("2022.findings-emnlp.341")
get_code_for_paper("2022.findings-emnlp.341")
have("2022.findings-emnlp.341")

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

curl https://syntology.ai/api/ran/2022.findings-emnlp.341.json

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

[![Syntology run record](https://syntology.ai/api/ran/2022.findings-emnlp.341.svg)](https://syntology.ai/paper/2022.findings-emnlp.341)

Connect an agent — have() is free.