SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1907.02684 · 2019

Head-Driven Phrase Structure Grammar Parsing on Penn Treebank

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; 1 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 1 failure of our instrument; 1 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/1907.02684.json · badge: /api/ran/1907.02684.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
DoodleJZ/HPSG-Neural-Parser canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
swish Ran
ran; our contract draft was wrong, not the code
DoodleJZ/HPSG-Neural-Parser/src_division/pretrained_bert/modeling.py
code served (permissive licence) · get_code("0f786c407fb1ee4c")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:33:52Z). 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 torch

torch.manual_seed(0)

# The function swish takes a single parameter 'x' which is used with:
# - torch.sigmoid(x) - requires a tensor
# - x * ... - requires a tensor that supports multiplication
# So x should be a tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
arabic Ran
ran on a synthesized input
DoodleJZ/HPSG-Neural-Parser/src_division/transliterate.py
code served (permissive licence) · get_code("c6fbc9f36f128a4d")
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.

# Setup code for arabic() function

ARGS = {
    'inp': 'bism'
}

# Test with a Buckwalter escape sequence
ARGS_ESCAPED = {
    'inp': '-LRB-test-RRB-'
}

# Test with mixed content
ARGS_MIXED = {
    'inp': "b'Asoma"
}

# Primary test case
ARGS = {
    'inp': 'bism'
}
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
eval Ran
ran on a synthesized input
DoodleJZ/HPSG-Neural-Parser/src_division/dep_eval.py
code served (permissive licence) · get_code("7c6d53ae2f79bef0")
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 re

torch.manual_seed(0)

# Analyzing the function:
# - batch_size: int, number of sentences
# - words: list of lists, words[i][j] is a string word
# - postags: list of lists, postags[i][j] is a string POS tag
# - heads_pred: list of lists, heads_pred[i][j] is an int (head index)
# - types_pred: list of lists, types_pred[i][j] is a string (dependency type)
# - heads: list of lists, heads[i][j] is an int (gold head index)
# - types: list of lists, types[i][j] is a string (gold dependency type)
# - lengths: list of ints, lengths[i] is the length of sentence i
# - punct_set: optional set of POS tags that are punctuation
# - symbolic_root: bool
# - symbolic_end: bool

# Building minimal valid arguments:
batch_size = 2

# words: list of lists of strings
words = [
    ["ROOT", "The", "cat", "sat"],
    ["ROOT", "Dogs", "run"]
]

# postags: list of lists of strings
postags = [
    ["ROOT", "DET", "NOUN", "VERB"],
    ["ROOT", "NOUN", "VERB"]
]

# heads_pred: list of lists of ints (predicted head indices)
heads_pred = [
    [0, 2, 3, 0],
    [0, 2, 0]
]

# types_pred: list of lists of strings (predicted dependency types)
types_pred = [
    ["root", "det", "nsubj", "root"],
    ["root", "nsubj", "root"]
]

# heads: list of lists of ints (gold head indices)
heads = [
    [0, 2, 3, 0],
    [0, 2, 0]
]

# types: list of lists of strings (gold dependency types)
types = [
    ["root", "det", "nsubj", "root"],
    ["root", "nsubj", "root"]
]

# lengths: list of ints
lengths = [4, 3]

# punct_set: optional set of POS tags
punct_set = {"PU", "PUNCT"}

# symbolic_root and symbolic_end flags
symbolic_root = True
symbolic_end = False

ARGS = {
    "batch_size": batch_size,
    "words": words,
    "postags": postags,
    "heads_pred": heads_pred,
    "types_pred": types_pred,
    "heads": heads,
    "types": types,
    "lengths": lengths,
    "punct_set": punct_set,
    "symbolic_root": symbolic_root,
    "symbolic_end": symbolic_end
}
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
eval Ran
ran on a synthesized input
DoodleJZ/HPSG-Neural-Parser/src_joint/dep_eval.py
code served (permissive licence) · get_code("ee2ae5eb22ec1250")
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 torch.nn as nn

torch.manual_seed(0)

# Construct the ARGS dictionary with valid arguments for the eval function

batch_size = 2
seq_len_1 = 5
seq_len_2 = 4

# words: list of lists of strings (word tokens)
words = [
    ["The", "cat", "sat", ".", "ROOT"],
    ["I", "like", "dogs", "ROOT"]
]

# postags: list of lists of strings (part-of-speech tags)
postags = [
    ["DET", "NOUN", "VERB", "PU", "ROOT"],
    ["PRON", "VERB", "NOUN", "ROOT"]
]

# heads_pred: list of lists of integers (predicted head indices)
heads_pred = [
    [0, 1, 1, 1, 0],
    [0, 1, 1, 0]
]

# types_pred: list of lists of strings (predicted dependency types)
types_pred = [
    ["root", "det", "nsubj", "punct", "root"],
    ["root", "nsubj", "obj", "root"]
]

# heads: list of lists of integers (gold head indices)
heads = [
    [0, 2, 1, 2, 0],
    [0, 1, 1, 0]
]

# types: list of lists of strings (gold dependency types)
types = [
    ["root", "det", "nsubj", "punct", "root"],
    ["root", "nsubj", "obj", "root"]
]

# lengths: list of integers (lengths of each sentence)
lengths = [5, 4]

# punct_set: set of POS tags considered as punctuation
punct_set = {"PU", "PUNCT"}

# Build ARGS dictionary
ARGS = {
    "batch_size": batch_size,
    "words": words,
    "postags": postags,
    "heads_pred": heads_pred,
    "types_pred": types_pred,
    "heads": heads,
    "types": types,
    "lengths": lengths,
    "punct_set": punct_set,
    "symbolic_root": False,
    "symbolic_end": False
}
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
gelu Ran
ran, honoured the contract we drafted
DoodleJZ/HPSG-Neural-Parser/src_division/pretrained_bert/modeling.py
pointer only (licence: MIT); the stored copy get_code serves, from shmsw25/qa-hard-em, is pointer only (licence: NONE) · get_code("40e9fee2e0b7e278")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from shmsw25/qa-hard-em, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

hebrew Ran
ran on a synthesized input
DoodleJZ/HPSG-Neural-Parser/src_division/transliterate.py
code served (permissive licence) · get_code("98db1b220dd2ecb7")
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.

# Setup code for the hebrew function

ARGS = {
    'inp': 'ABGH'
}
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
is_punctuation Ran
ran on a synthesized input
DoodleJZ/HPSG-Neural-Parser/src_division/dep_eval.py
code served (permissive licence) · get_code("840468e2d4759f6a")
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 re

def is_uni_punctuation(word):
    match = re.match('^[^\\w\\s]+$]', word, flags=re.UNICODE)
    return match is not None

def is_punctuation(word, pos, punct_set=None):
    if punct_set is None:
        return is_uni_punctuation(word)
    else:
        return pos in punct_set or pos == 'PU'

# Setup code to construct valid arguments
word = "!!!"
pos = "PUNCT"
punct_set = {"PUNCT", "SYM", "PU"}

ARGS = {
    "word": word,
    "pos": pos,
    "punct_set": punct_set
}
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 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
is_uni_punctuation Ran
ran on a synthesized input
DoodleJZ/HPSG-Neural-Parser/src_division/dep_eval.py
code served (permissive licence) · get_code("1c8660c9c598820b")
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 re

def is_uni_punctuation(word):
    match = re.match('^[^\\w\\s]+$]', word, flags=re.UNICODE)
    return match is not None

# Test with various word inputs
test_word_1 = "!!!"
test_word_2 = "hello"
test_word_3 = "..."
test_word_4 = "@#$"

ARGS = {
    "word": test_word_1
}
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 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_trees Not yet run
unverified (harvested, no recorded run)
DoodleJZ/HPSG-Neural-Parser/src_division/trees.py
code served (permissive licence) · get_code("d32f40efd7da15c3")
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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 4 later) and 5 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
swish 206 other papers
12 dated earlier, 194 later · 44 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1805.12114 (2018-05)
Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models
1809.01357 (2018-09)
Zero Shot Learning for Code Education: Rubric Sampling with Deep Learning Inference
and 203 more not named here
gelu 198 other papers
13 dated earlier, 185 later · 32 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.10125 (2019-01)
Glyce: Glyph-vectors for Chinese Character Representations
and 195 more not named here
arabic 3 other papers
2 dated earlier, 1 later
1805.01052 (2018-05)
Constituency Parsing with a Self-Attentive Encoder
1812.11760 (2018-12)
Multilingual Constituency Parsing with Self-Attention and Pre-Training
2021.acl-long.205 (2021 (year only))
N -ary Constituent Tree Parsing with Recursive Semi-Markov Model
hebrew 3 other papers
2 dated earlier, 1 later
1805.01052 (2018-05)
Constituency Parsing with a Self-Attentive Encoder
1812.11760 (2018-12)
Multilingual Constituency Parsing with Self-Attention and Pre-Training
2021.acl-long.205 (2021 (year only))
N -ary Constituent Tree Parsing with Recursive Semi-Markov Model

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

Head-driven phrase structure grammar (HPSG) enjoys a uniform formalism representing rich contextual syntactic and even semantic meanings. This paper makes the first attempt to formulate a simplified HPSG by integrating constituent and dependency formal representations into head-driven phrase structure. Then two parsing algorithms are respectively proposed for two converted tree representations, division span and joint span. As HPSG encodes both constituent and dependency structure information, the proposed HPSG parsers may be regarded as a sort of joint decoder for both types of structures and thus are evaluated in terms of extracted or converted constituent and dependency parsing trees. Our parser achieves new state-of-the-art performance for both parsing tasks on Penn Treebank (PTB) and Chinese Penn Treebank, verifying the effectiveness of joint learning constituent and dependency structures. In details, we report 96.33 F1 of constituent parsing and 97.20\% UAS of dependency parsing on PTB.

For agents

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

get_harvested_code_for_paper("1907.02684")
get_code_for_paper("1907.02684")
have("1907.02684")

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

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

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

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

Connect an agent — have() is free.