SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1810.12936 · 2018

NPRF: A Neural Pseudo Relevance Feedback Framework for Ad-hoc Information Retrieval

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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 4 have no contract verdict; 0 failures of our instrument; 2 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/1810.12936.json · badge: /api/ran/1810.12936.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
ucasir/NPRF canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
get_word_vec Ran
ran on a synthesized input
ucasir/NPRF/preprocess/matrix.py
code served (permissive licence) · get_code("e52e3b386be1d9cb")
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 (4,) 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

class MockEmbeddings:
    """Mock embeddings object with vector_size attribute and word_vec method."""
    def __init__(self, vector_size=4):
        self.vector_size = vector_size
        self._word_vecs = {
            "hello": np.array([0.1, 0.2, 0.3, 0.4]),
            "world": np.array([0.5, 0.6, 0.7, 0.8]),
        }
    
    def word_vec(self, word):
        """Returns word vector or raises KeyError if not found."""
        return self._word_vecs[word]

embeddings = MockEmbeddings(vector_size=4)
oov_dict = {}

ARGS = {
    "word": "hello",
    "embeddings": embeddings,
    "OOV_dict": oov_dict,
}
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 (4,) — shape (4,) 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
hist_from_matrix Ran
ran on a synthesized input
ucasir/NPRF/preprocess/matrix.py
code served (permissive licence) · get_code("8de864fea0ae24a8")
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 (10, 5) 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

text_maxlen = 10
hist_size = 5
sim_mat = np.random.uniform(-1.0, 1.0, size=(8, 6)).astype(np.float32)

ARGS = {
    "text_maxlen": text_maxlen,
    "hist_size": hist_size,
    "sim_mat": sim_mat,
}
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 2, dtype family float, shape (10, 5) — shape (10, 5) 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
update_qrels_relevance Ran
ran on a synthesized input
ucasir/NPRF/preprocess/prepare.py
code served (permissive licence) · get_code("54587c99f765d612")
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 OrderedDict. 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
from collections import OrderedDict

# Create a temporary qrels file
temp_qrels = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
qrels_content = """1 0 doc1 2
1 0 doc2 1
1 0 doc3 0
2 0 doc1 1
2 0 doc4 2
2 0 doc5 0
3 0 doc2 2
3 0 doc6 1"""
temp_qrels.write(qrels_content)
temp_qrels.close()
qrels_file_path = temp_qrels.name

# Create a docno_map that maps docno strings to docid integers
docno_map = {
    'doc1': 101,
    'doc2': 102,
    'doc3': 103,
    'doc4': 104,
    'doc5': 105,
    'doc6': 106,
}

ARGS = {
    'qrels_file': qrels_file_path,
    'docno_map': docno_map,
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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_res_relevance Ran
ran on a synthesized input
ucasir/NPRF/preprocess/prepare.py
code served (permissive licence) · get_code("d4fdda7951e2c107")
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 OrderedDict. 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 os
from collections import OrderedDict

# Create a temporary results file with sample data
temp_dir = tempfile.mkdtemp()
res_file = os.path.join(temp_dir, "results.txt")

# Write sample results file in TREC format
# Format: qid Q0 docno rank score run_id
with open(res_file, 'w') as f:
    f.write("1 Q0 doc001 1 10.5 run1\n")
    f.write("1 Q0 doc002 2 9.3 run1\n")
    f.write("1 Q0 doc003 3 8.1 run1\n")
    f.write("2 Q0 doc004 1 7.2 run1\n")
    f.write("2 Q0 doc005 2 6.8 run1\n")
    f.write("3 Q0 doc001 1 5.5 run1\n")

# Create a docno_map that maps document numbers to document IDs
docno_map = {
    "doc001": 101,
    "doc002": 102,
    "doc003": 103,
    "doc004": 104,
    "doc005": 105,
}

ARGS = {
    "res_file": res_file,
    "docno_map": docno_map,
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
rank_hinge_loss Not yet run
unverified (harvested, no recorded run)
ucasir/NPRF/metrics/rank_losses.py
code served (permissive licence) · get_code("f8a68c601c679661")
How it ran

no invocation recorded.

update_qrels_from_res_and_qrels Not yet run
unverified (harvested, no recorded run)
ucasir/NPRF/preprocess/prepare.py
code served (permissive licence) · get_code("7986b7c47df8beb5")
How it ran

no invocation recorded.

Also present in other papers' code

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

Pseudo-relevance feedback (PRF) is commonly used to boost the performance of traditional information retrieval (IR) models by using top-ranked documents to identify and weight new query terms, thereby reducing the effect of query-document vocabulary mismatches. While neural retrieval models have recently demonstrated strong results for ad-hoc retrieval, combining them with PRF is not straightforward due to incompatibilities between existing PRF approaches and neural architectures. To bridge this gap, we propose an end-to-end neural PRF framework that can be used with existing neural IR models by embedding different neural models as building blocks. Extensive experiments on two standard test collections confirm the effectiveness of the proposed NPRF framework in improving the performance of two state-of-the-art neural IR models.

For agents

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

get_harvested_code_for_paper("1810.12936")
get_code_for_paper("1810.12936")
have("1810.12936")

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

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

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

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

Connect an agent — have() is free.