SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.14171 · 2020

SE-KGE: A Location-Aware Knowledge Graph Embedding Model for Geographic Question Answering and Spatial Semantic Lifting

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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 8 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2004.14171.json · badge: /api/ran/2004.14171.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
gengchenmai/se-kge community (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
check_conv Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/train_helpers.py
code served (permissive licence) · get_code("fb6b6142dc78af3b")
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 bool, ndim 0, dtype family float, shape () 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 list of evaluation scores that demonstrates convergence
# We need at least 2 * window items (default window=2, so 4 items minimum)
# Create values that show convergence: early scores vary, later scores stabilize
vals = [0.5, 0.45, 0.42, 0.41, 0.40, 0.40, 0.40, 0.40]

ARGS = {
    "vals": vals,
    "window": 2,
    "tol": 1e-06
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
coord_normalize Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/module.py
code served (permissive licence) · get_code("d4558066552ab565")
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 3, dtype family float, shape (2, 3, 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 sample coordinates
# Shape: (batch_size=2, num_context_pt=3, coord_dim=2)
coords_list = [
    [[1700000, 1620000], [1705000, 1625000], [1708000, 1630000]],
    [[1695000, 1615000], [1700000, 1620000], [1702000, 1628000]]
]

# Default extent parameter
extent = (-1710000, -1690000, 1610000, 1640000)

ARGS = {
    "coords": coords_list,
    "extent": extent
}
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 3, dtype family float, shape (2, 3, 2) — shape (2, 3, 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
cudify Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/utils.py
code served (permissive licence) · get_code("7a6f462abd984fdf")
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 function. 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 torch.nn as nn

torch.manual_seed(0)

# Create small embedding modules for each node type
class EmbeddingModule(nn.Module):
    def __init__(self, num_embeddings, embedding_dim):
        super().__init__()
        self.embedding = nn.Embedding(num_embeddings, embedding_dim)
    
    def forward(self, indices):
        return self.embedding(indices)

# Define node types
node_types = ['function', 'sideeffects', 'protein', 'disease', 'drug']

# Create feature_modules dict with small embedding matrices
# Each embedding has [num_ent_by_type + 2, embed_dim]
feature_modules = {
    'function': EmbeddingModule(num_embeddings=6, embedding_dim=4),      # 4+2=6
    'sideeffects': EmbeddingModule(num_embeddings=7, embedding_dim=4),   # 5+2=7
    'protein': EmbeddingModule(num_embeddings=8, embedding_dim=4),       # 6+2=8
    'disease': EmbeddingModule(num_embeddings=9, embedding_dim=4),       # 7+2=9
    'drug': EmbeddingModule(num_embeddings=10, embedding_dim=4),         # 8+2=10
}

# Create node_maps dict mapping global node ids to local node ids
node_maps = {
    'function': {0: 0, 1: 1, 2: 2},
    'sideeffects': {10: 0, 11: 1, 12: 2},
    'protein': {20: 0, 21: 1, 22: 2},
    'disease': {30: 0, 31: 1, 32: 2},
    'drug': {40: 0, 41: 1, 42: 2},
}

ARGS = {
    'feature_modules': feature_modules,
    'node_maps': node_maps,
    'device': 'cpu'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
detect_cuda_device Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/utils.py
code served (permissive licence) · get_code("6557feb6e351276c")
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. 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

torch.manual_seed(0)

ARGS = {
    'device': 'cpu'
}
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 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
geo_lookup Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/encoders.py
code served (permissive licence) · get_code("49dadff064c14b39")
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 random
import torch

torch.manual_seed(0)

# Build valid arguments for geo_lookup
nodes = [0, 1, 2, 3]

id2geo = {
    0: [10.5, 20.3],
    1: [15.2, 25.7],
    2: [12.1, 22.4],
    # node 3 is deliberately missing to test nogeo case
}

id2extent = {
    0: [10.0, 11.0, 20.0, 21.0],  # xmin, xmax, ymin, ymax
    1: [15.0, 16.0, 25.0, 26.0],
}

add_dim = -1

doExtentSample = False

ARGS = {
    "nodes": nodes,
    "id2geo": id2geo,
    "add_dim": add_dim,
    "id2extent": id2extent,
    "doExtentSample": doExtentSample,
}
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
get_activation_function Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/module.py
code served (permissive licence) · get_code("0bb68fd06ed2366f")
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 LeakyReLU. 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 torch.nn as nn

torch.manual_seed(0)

# The function takes two parameters:
# 1. activation: a string specifying which activation function to use
# 2. context_str: a string used in error messages for context

ARGS = {
    'activation': 'leakyrelu',
    'context_str': 'test_layer'
}
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 LeakyReLU — a LeakyReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LeakyReLU 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
make_args_combine Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/trainer.py
code served (permissive licence) · get_code("d644f9daf4384fff")
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 torch
import numpy as np
from types import SimpleNamespace

torch.manual_seed(0)

# Create a SimpleNamespace object with all required attributes
args = SimpleNamespace(
    # Boolean flags
    use_relu=True,
    use_inter_node=True,
    kg_train=True,
    geo_train=False,
    
    # Task and general params
    task='qa',
    data_dir='/path/to/dataset_name/',
    depth=3,
    embed_dim=64,
    batch_size=32,
    inter_weight=0.5,
    path_weight=0.3,
    decoder='transformer',
    
    # Inter-decoder params (used when task=='qa')
    inter_decoder='gru',
    inter_decoder_atten_type='dot',
    inter_decoder_atten_act='relu',
    inter_decoder_atten_f_act='tanh',
    inter_decoder_atten_num=4,
    max_arity=5,
    
    # Spatial encoding params
    spa_enc_type='fourier',
    geo_info='lat_lon',
    enc_agg_type='mean',
    spa_embed_dim=32,
    freq=10,
    max_radius=1000.0,
    min_radius=10.0,
    spa_f_act='relu',
    freq_init='log',
    spa_enc_use_postmat='T',
    spa_enc_embed_norm='T',
    
    # RBF params
    anchor_sample_method='kmeans',
    num_rbf_anchor_pts=20,
    rbf_kernal_size=5.0,
    
    # FFN params
    num_hidden_layer=2,
    hidden_dim=128,
    use_layn='T',
    skip_connection='T',
    dropout=0.1,
)

ARGS = {
    'args': args
}
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 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
update_loss Ran
ran on a synthesized input
gengchenmai/se-kge/graphqa/netquery/train_helpers.py
code served (permissive licence) · get_code("529a9a60c4c690ff")
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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - loss: a scalar value (used in arithmetic operations)
# - losses: a list that gets appended to
# - ema_loss: either None or a scalar value (used in arithmetic operations)
# - ema_alpha: a float parameter with default 0.01

ARGS = {
    "loss": 0.5,
    "losses": [],
    "ema_loss": None,
    "ema_alpha": 0.01
}
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 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
entity_embeding_lookup Not yet run
unverified (harvested, no recorded run)
gengchenmai/se-kge/graphqa/netquery/utils.py
code served (permissive licence) · get_code("3e183d5cc5218871")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 7 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
coord_normalize 1 other paper
1 later
2209.15458 (2022-09)
Towards General-Purpose Representation Learning of Polygonal Geometries
get_activation_function 1 other paper
1 later
2209.15458 (2022-09)
Towards General-Purpose Representation Learning of Polygonal Geometries

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

Learning knowledge graph (KG) embeddings is an emerging technique for a variety of downstream tasks such as summarization, link prediction, information retrieval, and question answering. However, most existing KG embedding models neglect space and, therefore, do not perform well when applied to (geo)spatial data and tasks. For those models that consider space, most of them primarily rely on some notions of distance. These models suffer from higher computational complexity during training while still losing information beyond the relative distance between entities. In this work, we propose a location-aware KG embedding model called SE-KGE. It directly encodes spatial information such as point coordinates or bounding boxes of geographic entities into the KG embedding space. The resulting model is capable of handling different types of spatial reasoning. We also construct a geographic knowledge graph as well as a set of geographic query-answer pairs called DBGeo to evaluate the performance of SE-KGE in comparison to multiple baselines. Evaluation results show that SE-KGE outperforms these baselines on the DBGeo dataset for geographic logic query answering task. This demonstrates the effectiveness of our spatially-explicit model and the importance of considering the scale of different geographic entities. Finally, we introduce a novel downstream task called spatial semantic lifting which links an arbitrary location in the study area to entities in the KG via some relations. Evaluation on DBGeo shows that our model outperforms the baseline by a substantial margin.

For agents

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

get_harvested_code_for_paper("2004.14171")
get_code_for_paper("2004.14171")
have("2004.14171")

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

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

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

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

Connect an agent — have() is free.