SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.17388 · 2024

Can LLMs be Good Graph Judge for Knowledge Graph Construction?

arXiv · PDF · Open in the Atlas

Code that ran

9 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 5 have no contract verdict; 4 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/2411.17388.json · badge: /api/ran/2411.17388.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
hhy-huang/graphjudge canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
api_model Ran
ran on a synthesized input
hhy-huang/graphjudge/chat/run_chatgpt.py
code served (permissive licence) · get_code("fa9b6da71c2092cf")
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 coroutine. 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 asyncio
from unittest.mock import AsyncMock, MagicMock

# Mock the OpenAI AsyncOpenAI client
class MockMessage:
    def __init__(self, content):
        self.content = content

class MockChoice:
    def __init__(self, content):
        self.message = MockMessage(content)

class MockResponse:
    def __init__(self, content):
        self.choices = [MockChoice(content)]

class MockChatCompletion:
    async def create(self, **kwargs):
        return MockResponse("This is a mock response from the API.")

class MockAsyncOpenAI:
    def __init__(self, api_key=None, base_url=None):
        self.chat = MagicMock()
        self.chat.completions = MockChatCompletion()

# Patch the OpenAI import
import sys
from unittest.mock import MagicMock
mock_openai = MagicMock()
mock_openai.AsyncOpenAI = MockAsyncOpenAI
sys.modules['openai'] = mock_openai

# Now define the ARGS
ARGS = {
    'prompt': 'What is the capital of France?',
    'system_prompt': 'You are a helpful assistant.',
    'history_messages': [
        {'role': 'user', 'content': 'Hello'},
        {'role': 'assistant', 'content': 'Hi there!'}
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
api_model Ran
ran on a synthesized input
hhy-huang/graphjudge/chat/run_chatgpt_entity.py
code served (permissive licence) · get_code("33e9d014a6ae7fde")
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 coroutine. 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 asyncio
from unittest.mock import AsyncMock, MagicMock

# Mock the AsyncOpenAI client and its response
class MockMessage:
    def __init__(self):
        self.content = "This is a mock response from the API."

class MockChoice:
    def __init__(self):
        self.message = MockMessage()

class MockResponse:
    def __init__(self):
        self.choices = [MockChoice()]

class MockChatCompletion:
    async def create(self, **kwargs):
        return MockResponse()

class MockAsyncOpenAI:
    def __init__(self, api_key=None, base_url=None):
        self.api_key = api_key
        self.base_url = base_url
        self.chat = MagicMock()
        self.chat.completions = MockChatCompletion()

# Patch the AsyncOpenAI import
import sys
from unittest.mock import MagicMock as Mock
sys.modules['openai'] = Mock()
sys.modules['openai'].AsyncOpenAI = MockAsyncOpenAI

# Define arguments for the api_model function
ARGS = {
    'prompt': 'What is the capital of France?',
    'system_prompt': 'You are a helpful assistant.',
    'history_messages': [
        {'role': 'assistant', 'content': 'Hello! How can I help you today?'},
        {'role': 'user', 'content': 'Hi there!'}
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
denoise_text Ran
ran on a synthesized input
hhy-huang/graphjudge/chat/run_chatgpt_entity.py
code served (permissive licence) · get_code("0d1ca82eaad4ea6d")
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 coroutine. 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 asyncio
from typing import List

# Define ARGS dict with valid arguments for denoise_text function
ARGS = {
    'texts': [
        "John Smith is a software engineer who works at Google. He was born on January 15, 1990 in San Francisco. He specializes in machine learning.",
        "Marie Curie was a Polish physicist and chemist. She conducted pioneering research on radioactivity. She was born on November 7, 1867 in Warsaw."
    ],
    'entities_list': [
        ["John Smith", "software engineer", "Google", "January 15, 1990", "San Francisco", "machine learning"],
        ["Marie Curie", "physicist", "chemist", "radioactivity", "November 7, 1867", "Warsaw"]
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
extract_entities Ran
ran on a synthesized input
hhy-huang/graphjudge/chat/run_chatgpt_entity.py
code served (permissive licence) · get_code("5cc881bcb8e83712")
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 coroutine. 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 asyncio
from unittest.mock import AsyncMock, MagicMock, patch

# Set up minimal arguments for extract_entities function
texts = [
    "Shotgate Thickets is a nature reserve in the United Kingdom operated by the Essex Wildlife Trust.",
    "Mount Everest is the highest mountain in the world located in the Himalayas."
]

ARGS = {
    'texts': texts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
generate_advanced_prompt Ran
ran; our contract draft was wrong, not the code
hhy-huang/graphjudge/graph_judger/lora_infer_batch.py
code served (permissive licence) · get_code("e9255fb036722c39")
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

# Analyze the function: it takes 'instruction' (required) and 'input' (optional)
# The function uses these parameters in an f-string to construct a prompt
# instruction is inserted directly into the prompt
# input parameter is defined but not used in the function body

ARGS = {
    "instruction": "Apple Founded by Mark Zuckerberg",
    "input": None
}
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
generate_prompt Ran
ran; our contract draft was wrong, not the code
hhy-huang/graphjudge/graph_judger/lora_infer.py
code served (permissive licence) · get_code("e96ec96db9ef37ba")
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

ARGS = {
    "instruction": "What is the capital of France?",
    "input": "France is a country in Western Europe."
}
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
generate_prompt Ran
ran; our contract draft was wrong, not the code
hhy-huang/graphjudge/graph_judger/lora_infer_batch.py
code served (permissive licence) · get_code("fa02d989f7ad994f")
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

torch.manual_seed(0)

# The function generate_prompt takes a single parameter: instruction
# It expects a string that describes a task
# The function uses it in an f-string to construct a prompt

instruction = "Summarize the key points of machine learning."

ARGS = {
    "instruction": instruction
}
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
get_chatgpt_completion Ran
ran on a synthesized input
hhy-huang/graphjudge/chat/run_chatgpt_gj.py
code served (permissive licence) · get_code("6f1e024958dca36b")
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 coroutine. 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 asyncio
from unittest.mock import AsyncMock, MagicMock

# Create a mock aiohttp ClientSession
session = AsyncMock()

# Create a mock response that returns a properly formatted GPT response
mock_response = AsyncMock()
mock_response.json = AsyncMock(return_value={
    'choices': [
        {
            'message': {
                'content': 'This is a mock GPT response.'
            }
        }
    ]
})

# Set up the session.post context manager to return the mock response
session.post = AsyncMock()
session.post.return_value.__aenter__ = AsyncMock(return_value=mock_response)
session.post.return_value.__aexit__ = AsyncMock(return_value=None)

instruction = "Summarize the following text"
input_text = "The quick brown fox jumps over the lazy dog."

ARGS = {
    'session': session,
    'instruction': instruction,
    'input_text': input_text
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
process_input Ran
ran; our contract draft was wrong, not the code
hhy-huang/graphjudge/graph_judger/bert_classifier_infer.py
code served (permissive licence) · get_code("d47506b71865ea46")
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

torch.manual_seed(0)

ARGS = {
    'instruction': 'Translate the following text to French',
    'input_text': 'Hello, how are you?'
}
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

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, 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 9 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

In real-world scenarios, most of the data obtained from the information retrieval (IR) system is unstructured. Converting natural language sentences into structured Knowledge Graphs (KGs) remains a critical challenge. We identified three limitations with respect to existing KG construction methods: (1) There could be a large amount of noise in real-world documents, which could result in extracting messy information. (2) Naive LLMs usually extract inaccurate knowledge from some domain-specific documents. (3) Hallucination phenomenon cannot be overlooked when directly using LLMs to construct KGs. In this paper, we propose \textbf{GraphJudge}, a KG construction framework to address the aforementioned challenges. In this framework, we designed an entity-centric strategy to eliminate the noise information in the documents. And we fine-tuned a LLM as a graph judge to finally enhance the quality of generated KGs. Experiments conducted on two general and one domain-specific text-graph pair datasets demonstrate state-of-the-art performance against various baseline methods with strong generalization abilities. Our code is available at \href{https://github.com/hhy-huang/GraphJudge}{https://github.com/hhy-huang/GraphJudge}.

For agents

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

get_harvested_code_for_paper("2411.17388")
get_code_for_paper("2411.17388")
have("2411.17388")

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

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

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

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

Connect an agent — have() is free.