SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.02549 · ACL Findings · 2022

C 3 KG: A Chinese Commonsense Conversation Knowledge Graph

Bin Wang, Jiayi Zhang, Ke Li, Dawei Li, Chen Wei, Yanran Li, Jianwei Cui

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 6 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/2204.02549.json · badge: /api/ran/2204.02549.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
XiaoMi/C3KG canonical (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
FunctionStatusWhere it lives
append_tail Ran
ran on a synthesized input
XiaoMi/C3KG/utils.py
code served (permissive licence) · get_code("54601ae4258bf376")
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 head2tail dictionary
# Structure: head2tail[head][relation] = [tail1, tail2, ...]
head2tail = {
    'person': {
        'xNeed': ['food', 'water'],
        'xAttr': ['tired', 'happy'],
        'xReact': ['laugh', 'cry'],
        'xEffect': ['sleep', 'eat'],
        'xWant': ['rest', 'play'],
        'xIntent': ['work', 'study'],
        'oEffect': ['help', 'harm'],
        'oWant': ['give', 'take'],
        'oReact': ['smile', 'frown'],
        'isBefore': ['walk', 'run'],
        'isAfter': ['arrive', 'leave'],
        'HasSubEvent': ['step', 'jump'],
        'unusedRelation': ['unused_tail']
    },
    'dog': {
        'xNeed': ['bone'],
        'xAttr': ['furry'],
        'xReact': ['bark'],
        'xEffect': ['wag'],
        'xWant': ['play'],
        'xIntent': ['fetch'],
        'oEffect': ['bite'],
        'oWant': ['give'],
        'oReact': ['growl'],
        'isBefore': ['sniff'],
        'isAfter': ['dig'],
        'HasSubEvent': ['jump'],
        'otherRelation': ['other_tail']
    }
}

# Construct item as a list of (head, similarity) tuples
# The function iterates: for head_similarity in item: for head, similarity in head_similarity:
# So item should be a list of iterables of (head, similarity) pairs
item = [
    [('person', 0.95), ('dog', 0.87)],
    [('person', 0.92)]
]

filter_relation = True

ARGS = {
    'item': item,
    'head2tail': head2tail,
    'filter_relation': filter_relation
}
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
build_translated_table Ran
ran on a synthesized input
XiaoMi/C3KG/preprocess/build_Chinese_ATOMIC.py
code served (permissive licence) · get_code("2e94649deb4c4793")
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 pandas as pd

# Create a small DataFrame with key and value columns
df = pd.DataFrame({
    'id': ['a', 'b', 'c'],
    'name': ['apple', 'banana', 'cherry']
})

ARGS = {
    'df': df,
    'key_col': 'id',
    'value_col': 'name'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
extract_keyword Ran
ran on a synthesized input
XiaoMi/C3KG/construct/construct_edge.py
code served (permissive licence) · get_code("f9c06d6f7601a396")
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 list, 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
import torch.nn as nn

class MockLTP:
    """Mock LTP model for keyword extraction"""
    def seg(self, content):
        # Simulate segmentation: return (segments, hidden_state)
        # segments is a list of lists of characters
        segments = [['这', '是'], ['一', '个'], ['测', '试']]
        hidden = "mock_hidden"
        return segments, hidden
    
    def pos(self, hidden):
        # Simulate POS tagging: return list of lists of POS tags
        # Each inner list corresponds to a segment
        pos_tags = [
            ['v', 'n'],      # 这(v) 是(n)
            ['a', 'v'],      # 一(a) 个(v)
            ['n', 'a']       # 测(n) 试(a)
        ]
        return pos_tags

# Create the global ltp mock object that the function will use
ltp = MockLTP()

# Define the content parameter
content = "这是一个测试"

ARGS = {
    "content": content
}
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 list, ndim 1, dtype family float — a list 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
match Ran
ran on a synthesized input
XiaoMi/C3KG/construct/extract_entity.py
code served (permissive licence) · get_code("96a7d2e42770e48d")
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 list, 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 torch

# The function match(src, trg) iterates through src and checks if each element
# is in trg, collecting matches. Both parameters should be iterables of comparable items.
# We'll use simple lists of integers or strings.

torch.manual_seed(0)

src = [1, 2, 3, 4, 5]
trg = [3, 4, 5, 6, 7]

ARGS = {
    "src": src,
    "trg": trg
}
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 list, ndim 1, dtype family int — a list 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
replace_head Ran
ran on a synthesized input
XiaoMi/C3KG/preprocess/replace.py
code served (permissive licence) · get_code("76ea2cc61268c105")
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 re

def replace_head(head):
    xy = re.compile('.*PersonX .* PersonY.*')
    xx = re.compile('.*PersonX .* PersonX.*')
    xxs = re.compile(".*PersonX .* PersonX\\'s .*")
    px1 = re.compile('.*PersonX.*')
    px2 = re.compile('.*personx.*')
    py1 = re.compile('.*PersonY.*')
    py2 = re.compile('.*persony.*')
    a_underline = re.compile('.* a ___.*')
    the_underline = re.compile('.* the ___.*')
    some_underline = re.compile('.* some ___.*')
    underline = re.compile('.* ___.*')
    has_xy = xy.match(head)
    if has_xy:
        head = head.replace('PersonY', 'someone else')
    has_xxs = xxs.match(head)
    if has_xxs:
        head = head.replace("PersonX's", 'his')
        head = head.replace('PersonX', 'someone')
    has_xx = xx.match(head)
    if has_xx:
        head = re.sub('PersonX', 'someone', head, 1)
        head = re.sub('PersonX', 'himself', head, 1)
    has_px1, has_px2, has_py1, has_py2 = (px1.match(head), px2.match(head), py1.match(head), py2.match(head))
    if has_px1 or has_px2 or has_py1 or has_py2:
        head = head.replace('PersonX', 'someone').replace('personx', 'someone').replace('PersonY', 'someone').replace('persony', 'someone')
    has_a_underline, has_the_underline, has_some_underline = (a_underline.match(head), the_underline.match(head), some_underline.match(head))
    if has_a_underline or has_the_underline or has_some_underline:
        head = head.replace('a ___', 'something').replace('the ___', 'something').replace('every ___', 'something')
    has_underline = underline.match(head)
    if has_underline:
        head = head.replace('___', 'something')
    return head

ARGS = {
    'head': 'PersonX gives a ___ to PersonY'
}
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 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
replace_tail Ran
ran on a synthesized input
XiaoMi/C3KG/preprocess/replace.py
code served (permissive licence) · get_code("007d5be13ecc2c10")
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 re

def replace_tail(tail):
    xxs_tail = re.compile(".*(Person.) .* (Person.)\\'s .*", re.I)
    xy_tail = re.compile('.*(Person.) .* (Person.).*', re.I)
    px_tail = re.compile('.*(Person.).*', re.I)
    a_underline = re.compile('.* a ___.*')
    the_underline = re.compile('.* the ___.*')
    some_underline = re.compile('.* some ___.*')
    underline = re.compile('.* ___.*')
    has_xxs = xxs_tail.match(tail)
    if has_xxs:
        if has_xxs.group(1).lower() == has_xxs.group(2).lower():
            tail = re.sub(has_xxs.group(1), 'someone', tail, 1)
            tail = re.sub(has_xxs.group(2) + "'s", 'his', tail, 1)
        else:
            tail = re.sub(has_xxs.group(1), 'someone', tail, 1)
            tail = re.sub(has_xxs.group(2) + "'s", "someone else's", tail, 1)
    has_xy = xy_tail.match(tail)
    if has_xy:
        if has_xy.group(1).lower() == has_xy.group(2).lower():
            tail = re.sub(has_xy.group(1), 'someone', tail, 1)
            tail = re.sub(has_xy.group(2), 'himself', tail, 1)
        else:
            tail = re.sub(has_xy.group(1), 'someone', tail, 1)
            tail = re.sub(has_xy.group(2), 'someone else', tail, 1)
    has_px = px_tail.match(tail)
    if has_px:
        tail = tail.replace(has_px.group(1), 'someone')
    has_a_underline, has_the_underline, has_some_underline = (a_underline.match(tail), the_underline.match(tail), some_underline.match(tail))
    if has_a_underline or has_the_underline or has_some_underline:
        tail = tail.replace('a ___', 'something').replace('the ___', 'something').replace('every ___', 'something')
    has_underline = underline.match(tail)
    if has_underline:
        tail = tail.replace('___', 'something')
    return tail

ARGS = {
    "tail": "Person1 gives Person2's book to Person3"
}
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 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
tail2label Not yet run
unverified (harvested, no recorded run)
XiaoMi/C3KG/construct/construct_edge.py
code served (permissive licence) · get_code("ac0b0811d0073be3")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Existing commonsense knowledge bases often organize tuples in an isolated manner, which is deficient for commonsense conversational models to plan the next steps. To fill the gap, we curate a large-scale multi-turn human-written conversation corpus, and create the first Chinese commonsense conversation knowledge graph which incorporates both social commonsense knowledge and dialog flow information. To show the potential of our graph, we develop a graph-conversation matching approach, and benchmark two graph-grounded conversational tasks. Our code and data could be found in https://github.com/XiaoMi/C3KG.

For agents

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

get_harvested_code_for_paper("2204.02549")
get_code_for_paper("2204.02549")
have("2204.02549")

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

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

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

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

Connect an agent — have() is free.