SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1902.07669 · 2019

ScispaCy: Fast and Robust Models for Biomedical Natural Language Processing

arXiv · PDF · Open in the Atlas

Code that ran

7 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 7 have no contract verdict; 0 failures of our instrument; 0 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/1902.07669.json · badge: /api/ran/1902.07669.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
allenai/scispacy canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
cached_path Ran
ran on a synthesized input
allenai/scispacy/scispacy/file_cache.py
code served (permissive licence) · get_code("38e0c973a4edfbda")
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 os
import tempfile
from pathlib import Path
from unittest.mock import Mock, patch, MagicMock

# Create a temporary directory for caching
temp_cache_dir = tempfile.mkdtemp()

# Test case 1: Local file path
local_file = tempfile.NamedTemporaryFile(delete=False, suffix='.txt')
local_file.write(b'test content')
local_file.close()
local_file_path = local_file.name

# Test case 2: URL string
url_string = "https://example.com/dataset.tar.gz"

# Test case 3: Path object
path_object = Path(local_file_path)

# Test case 4: Custom cache directory
custom_cache_dir = tempfile.mkdtemp()

ARGS = {
    'url_or_filename': local_file_path,
    'cache_dir': custom_cache_dir,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests, tqdm — 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
filename_to_url Ran
ran on a synthesized input
allenai/scispacy/scispacy/file_cache.py
code served (permissive licence) · get_code("5b5f3885feae8e80")
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 os
import json
import tempfile
from pathlib import Path

# Create a temporary directory to serve as our cache
temp_cache_dir = tempfile.mkdtemp()

# Create a test filename and its metadata
test_filename = "test_dataset.txt"
cache_path = os.path.join(temp_cache_dir, test_filename)
meta_path = cache_path + ".json"

# Write dummy data file
with open(cache_path, 'w') as f:
    f.write("test data")

# Write metadata file with url and etag
metadata = {
    "url": "https://example.com/dataset.txt",
    "etag": "abc123def456"
}
with open(meta_path, 'w') as f:
    json.dump(metadata, f)

# Define arguments for the function
ARGS = {
    "filename": test_filename,
    "cache_dir": temp_cache_dir
}
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 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
process_example Ran
ran on a synthesized input
allenai/scispacy/scispacy/data_util.py
code served (permissive licence) · get_code("21657ab6fe37fcec")
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 MedMentionExample. 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
from typing import List

# Define the NamedTuple classes as they appear in the function
class MedMentionEntity:
    def __init__(self, start: int, end: int, mention_text: str, mention_type: str, umls_id: str):
        self.start = start
        self.end = end
        self.mention_text = mention_text
        self.mention_type = mention_type
        self.umls_id = umls_id

class MedMentionExample:
    def __init__(self, title: str, abstract: str, text: str, pubmed_id: str, entities: List[MedMentionEntity]):
        self.title = title
        self.abstract = abstract
        self.text = text
        self.pubmed_id = pubmed_id
        self.entities = entities

# Create sample input lines that match the expected format:
# PMID | t | Title text
# PMID | a | Abstract text
# PMID TAB StartIndex TAB EndIndex TAB MentionTextSegment TAB SemanticTypeID TAB EntityID

lines = [
    "12345 | t | Sample Title",
    "12345 | a | This is a sample abstract with medical entities",
    "12345\t0\t6\tSample\tT001\tC0001",
    "12345\t14\t19\tmedical\tT002\tC0002",
]

ARGS = {
    "lines": lines,
}
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 MedMentionExample — a MedMentionExample 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
remove_new_lines Ran
ran on a synthesized input
allenai/scispacy/scispacy/custom_tokenizer.py
code served (permissive licence) · get_code("08b83e08022fef37")
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

# The function remove_new_lines takes a string parameter 'text'
# and performs various string replacements to remove newlines
# Let's create a representative test string with newlines and hyphens

test_text = """This is a document with some hyphenated words.
Some text here with-
a word split across lines.
Also has- 
another example.
And-

double newlines too."""

ARGS = {
    "text": test_text
}
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
remove_overlapping_entities Ran
ran on a synthesized input
allenai/scispacy/scispacy/data_util.py
code served (permissive licence) · get_code("b6927585ad29f738")
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 2, 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.

# Setup code for remove_overlapping_entities function

# The function takes a list of tuples in spacy format: (start, end, label)
# where start and end are character positions and label is a string entity type

# Create test data with overlapping entities
# Format: (start_position, end_position, entity_label)

# Example 1: Simple overlapping chain
# "New York City" - positions 0-13
# We create overlapping entities at these positions
sorted_spacy_format_entities = [
    (0, 3, "GPE"),      # "New"
    (0, 8, "GPE"),      # "New York"
    (4, 8, "GPE"),      # "York"
    (0, 13, "LOC"),     # "New York City"
    (9, 13, "LOC"),     # "City"
    (20, 25, "PERSON"), # Non-overlapping entity
]

# Sort by start position as expected by the function
sorted_spacy_format_entities = sorted(sorted_spacy_format_entities, key=lambda x: x[0])

ARGS = {
    "sorted_spacy_format_entities": sorted_spacy_format_entities
}
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 2, 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
select_subset_of_overlapping_chain Ran
ran on a synthesized input
allenai/scispacy/scispacy/data_util.py
code served (permissive licence) · get_code("b9b3cbcc3d52b7fe")
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 2, 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.

# Setup code for select_subset_of_overlapping_chain

# Create a list of tuples representing overlapping entities
# Each tuple is (start_position, end_position, entity_type)
# We'll create entities that have some overlaps

chain = [
    (0, 5, "PERSON"),      # length 5
    (2, 8, "ORGANIZATION"),  # length 6 - overlaps with first
    (3, 7, "LOCATION"),    # length 4 - overlaps with both
    (10, 15, "PERSON"),    # length 5 - no overlap
    (12, 14, "DATE"),      # length 2 - overlaps with previous
]

ARGS = {
    "chain": chain
}
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 2, 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
url_to_filename Ran
ran on a synthesized input
allenai/scispacy/scispacy/file_cache.py
code served (permissive licence) · get_code("c84ecd1eb5ee2729")
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.

from hashlib import sha256

# Analyze the function:
# - url: str - a URL string
# - etag: Optional[str] - an optional etag string
# The function splits the URL, encodes strings to bytes, computes SHA256 hashes,
# and concatenates them into a filename.

ARGS = {
    'url': 'https://example.com/path/to/model.bin',
    'etag': 'abc123def456'
}
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

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

Despite recent advances in natural language processing, many statistical models for processing text perform extremely poorly under domain shift. Processing biomedical and clinical text is a critically important application area of natural language processing, for which there are few robust, practical, publicly available models. This paper describes scispaCy, a new tool for practical biomedical/scientific text processing, which heavily leverages the spaCy library. We detail the performance of two packages of models released in scispaCy and demonstrate their robustness on several tasks and datasets. Models and code are available at https://allenai.github.io/scispacy/

For agents

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

get_harvested_code_for_paper("1902.07669")
get_code_for_paper("1902.07669")
have("1902.07669")

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

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

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

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

Connect an agent — have() is free.