SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-emnlp.123 · EMNLP Findings · 2024

INTENTIONQA: A Benchmark for Evaluating Purchase Intention Comprehension Abilities of Language Models in E-commerce

Junxian He, Xin Liu, Yangqiu Song, Zheng Li, Bing Yin, Chen Luo, Qingyu Yin, Tianqing Fang, Weiqi Wang, Wenxuan Ding, Minghao Liu, Jiaxin Bai, and 3 more

Open in the Atlas

Code that ran

11 of 15 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 11 have no contract verdict; 0 failures of our instrument; 4 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/2024.findings-emnlp.123.json · badge: /api/ran/2024.findings-emnlp.123.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
HKUST-KnowComp/IntentionQA canonical (classifier label)
classifier basis: census
11 ran · 4 no recorded run
FunctionStatusWhere it lives
LM_generation Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/evaluation/prompt_utils.py
code served (permissive licence) · get_code("ab5eda7413cee984")
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 time
from unittest.mock import Mock, MagicMock
import openai

# Create a mock response object that mimics OpenAI's response structure
mock_message = Mock()
mock_message.content = "This is a generated response."

mock_choice = Mock()
mock_choice.message = mock_message

mock_usage = Mock()
mock_usage.prompt_tokens = 5
mock_usage.completion_tokens = 3

mock_response = Mock()
mock_response.choices = [mock_choice]
mock_response.usage = mock_usage

# Create a mock client that returns the mock response
mock_client = Mock()
mock_client.chat.completions.create = Mock(return_value=mock_response)

# Patch the global client variable in the module
import sys
current_module = sys.modules[__name__]

# Store the mock client for use in the function
MOCK_CLIENT = mock_client

# Define the arguments for LM_generation
ARGS = {
    'prompt': 'What is the capital of France?',
    'max_tokens': 10,
    'temperature': 0.1,
    'model': 'gpt-35-turbo'
}
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 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
answer_parser_0shot Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/evaluation/computeACC.py
code served (permissive licence) · get_code("c7ea15417fd41f8d")
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

def answer_parser_0shot(response):
    response = response.strip('.')
    if len(response):
        return response[0].upper()
    else:
        return ' '

ARGS = {
    "response": "hello world."
}
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_neighborhood Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/negativeSampling/getEmbedding.py
code served (permissive licence) · get_code("62757b9a5f268bd9")
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 DiGraph. 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 networkx as nx

# Create a simple directed graph with predecessors, successors, and the origin node
G = nx.DiGraph()

# Add nodes
G.add_nodes_from([0, 1, 2, 3, 4])

# Add edges to create predecessors and successors of node 2
# Predecessors of 2: 0, 1
G.add_edge(0, 2)
G.add_edge(1, 2)

# Successors of 2: 3, 4
G.add_edge(2, 3)
G.add_edge(2, 4)

origin = 2

ARGS = {
    "origin": origin,
    "G": G
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiGraph — a DiGraph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DiGraph output the recorded ndim 1 and dtype family int 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
hasOverlapConcept Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/negativeSampling/computeSimilarity.py
code served (permissive licence) · get_code("a98a0e4ff98cae3f")
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 pandas as pd
import string

# Create a minimal DataFrame with the required structure
# The function expects columns 'id' and 'item_category'
data = {
    'id': ['item1', 'item2', 'item3', 'item4'],
    'item_category': [
        ['electronics computer'],
        ['electronics phone'],
        ['furniture chair'],
        ['furniture desk']
    ]
}
itemsInfo = pd.DataFrame(data)

A = 'item1'
B = 'item2'
C = 'item3'
D = 'item4'

ARGS = {
    'A': A,
    'B': B,
    'C': C,
    'D': D,
    'itemsInfo': itemsInfo
}
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 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
hasOverlapConcept Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/negativeSampling/getDistractors.py
code served (permissive licence) · get_code("afea7e5e2490f4c0")
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 pandas as pd

# Create a small DataFrame with the required structure
itemsInfo = pd.DataFrame({
    'id': ['item1', 'item2', 'item3', 'item4'],
    'item_category': [
        ['electronics computer'],
        ['electronics phone'],
        ['furniture chair'],
        ['furniture desk computer']
    ]
})

# Define arguments for the function
ARGS = {
    'A': 'item1',
    'B': 'item2',
    'C': 'item3',
    'D': 'item4',
    'itemsInfo': itemsInfo
}
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 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
load_pickle Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/evaluation/computeACC.py
code served (permissive licence) · get_code("714a24f63fa0ee61")
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 pickle
import tempfile
import os

# Create a temporary file and write some pickled data to it
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.pkl')
temp_filename = temp_file.name
temp_file.close()

# Write some sample data to the pickle file
sample_data = {
    'key1': [1, 2, 3],
    'key2': 'test_string',
    'key3': {'nested': 'dict'}
}

with open(temp_filename, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    'filename': temp_filename
}
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 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
normalize_name Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/filter/findNode_aser.py
code served (permissive licence) · get_code("57249a0b2f695064")
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
import string

puncs = list(string.punctuation)

def normalize_name(s):

    def remove_articles(text):
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(puncs)
        return ''.join((ch for ch in text if ch not in exclude))

    def lower(text):
        return text.lower()

    def remove_parentheses(text):
        pattern = '\\([^()]*\\)'
        result = re.sub(pattern, '', text)
        return result
    return white_space_fix(remove_articles(remove_punc(lower(remove_parentheses(s)))))

ARGS = {
    "s": "The Quick (Brown) Fox! A lazy dog, and the cat."
}
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
read_data Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/evaluation/askLM_task1.py
code served (permissive licence) · get_code("d08593bd98bcb5ea")
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 json
import tempfile
import os

# Create a temporary file with JSONL content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.jsonl")

# Write sample JSONL data
with open(temp_file, 'w') as f:
    f.write(json.dumps({"id": 1, "text": "hello"}) + "\n")
    f.write(json.dumps({"id": 2, "text": "world"}) + "\n")
    f.write(json.dumps({"id": 3, "text": "test"}) + "\n")

ARGS = {
    "filename": temp_file
}
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 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
resonAfterBecause Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/evaluation/prompt_utils.py
code served (permissive licence) · get_code("0cab62e19d915271")
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

torch.manual_seed(0)

# Test case 1: single string with 'because'
test_string_1 = "The sky is blue because water reflects light"

# Test case 2: single string with 'as a result, '
test_string_2 = "Plants grow as a result, they need sunlight"

# Test case 3: list of strings with mixed triggers
test_list = [
    "Dogs bark because they hear sounds",
    "Ice melts as a result, temperature increases",
    "Cats sleep during the day"
]

ARGS = {
    "assertions": test_string_1
}
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
resonAfterBecause Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/negativeSampling/QA_format.py
code served (permissive licence) · get_code("15f860de1f3a27ea")
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

def resonAfterBecause(assertions):
    for i in range(len(assertions)):
        index = assertions[i].find('because')
        if index == -1:
            index = assertions[i].find('as a result, ')
        if index == -1:
            print('WARNING! index (reasonAfterBecause/AsAResult) == -1!')
        assertions[i] = assertions[i][index:].strip()
    return assertions

ARGS = {
    'assertions': [
        'The sky is blue because it scatters light.',
        'Water freezes as a result, of cold temperatures.',
        'Plants grow toward sunlight because of phototropism.'
    ]
}
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
toPrompt_task1 Ran
ran on a synthesized input
HKUST-KnowComp/IntentionQA/evaluation/prompt_utils.py
code served (permissive licence) · get_code("4ae40b752a88d802")
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

# Construct arguments for toPrompt_task1
a = "apples"
b = "oranges"
options = {
    'A': 'Making a fruit salad',
    'B': 'Selling at a market',
    'C': 'Decorating a room'
}
mode = '0shot'

ARGS = {
    'a': a,
    'b': b,
    'options': options,
    'mode': mode
}
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
compute_assertionSimilarity Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/IntentionQA/negativeSampling/computeSimilarity.py
code served (permissive licence) · get_code("1ba0fbbf90a948d8")
How it ran

no invocation recorded.

count_tokens Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/IntentionQA/filter/simplifyName.py
code served (permissive licence) · get_code("f54f0325dfa091c7")
How it ran

no invocation recorded.

getResponse Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/IntentionQA/filter/simplifyName.py
code served (permissive licence) · get_code("19febdde49d33332")
How it ran

no invocation recorded.

normalize_items Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/IntentionQA/filter/findNode_aser.py
code served (permissive licence) · get_code("4c5ae6280e452fb0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 13 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
read_data 1 other paper
1 dated earlier
2023.findings-emnlp.1023 (2023 (year only))
QADYNAMICS: Training Dynamics-Driven Synthetic QA Diagnostic for Zero-Shot Commonsense Question Answering

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

Enhancing Language Models' (LMs) ability to understand purchase intentions in E-commerce scenarios is crucial for their effective assistance in various downstream tasks. However, previous approaches that distill intentions from LMs often fail to generate meaningful and human-centric intentions applicable in realworld E-commerce contexts. This raises concerns about the true comprehension and utilization of purchase intentions by LMs. In this paper, we present INTENTIONQA, a doubletask multiple-choice question answering benchmark to evaluate LMs' comprehension of purchase intentions in E-commerce. Specifically, LMs are tasked to infer intentions based on purchased products and utilize them to predict additional purchases. INTENTIONQA consists of 4,360 carefully curated problems across three difficulty levels, constructed using an automated pipeline to ensure scalability on large Ecommerce services. Human evaluations demonstrate the high quality and low false-negative rate of our benchmark. Extensive experiments across 19 language models show that they still struggle with certain scenarios, such as understanding products and intentions accurately, jointly reasoning with products and intentions, and more, in which they fall far behind human performances. Our code and data are publicly available at https://github.com/HKUST-KnowComp/IntentionQA.

For agents

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

get_harvested_code_for_paper("2024.findings-emnlp.123")
get_code_for_paper("2024.findings-emnlp.123")
have("2024.findings-emnlp.123")

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

curl https://syntology.ai/api/ran/2024.findings-emnlp.123.json

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

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

Connect an agent — have() is free.