Skip to main content

Oncoschema

Schema package for oncology extraction from cancer clinical documents.

Structure

📁 oncoschema
├── examples/            # Training examples showing document input and structured output
├── schema.py            # Pydantic model for specifying expected output structure
├── prompt_builder.py    # Prompt builder for data generation and inference
├── prompt_datagen.txt   # Prompt template with example (for training data generation)
├── prompt_main.txt      # Prompt template without example (for inference/deployment)
└── py.typed             # Type checking marker

Usage

from oncoschema.prompt_builder import PromptBuilder

# Initialize builder
builder = PromptBuilder()

# Build data generation prompt (with example)
datagen_prompt = builder.build_datagen_prompt()

# Build main/inference prompt (without example)
main_prompt = builder.build_main_prompt()

Schema

Schema overview

Type Values
TopographyType unknown_primary, other, haematological, lung, pleura, other_respiratory, oesophagus, stomach, small_intestine, colon, rectum, pancreas, liver, gallbladder, bile_duct, other_gi, kidney, bladder, prostate, testis, other_gu, breast, cervix, uterus, ovary, other_gynae, brain, spinal_cord, other_cns, oral, hypo_oro_naso_pharynx, larynx, salivary_gland, nasal_cavity, paranasal_sinus, thyroid, adrenal_gland, other_endocrine, skin, soft_tissue, bone
MorphologyType unknown_morphology, other, adenocarcinoma, squamous_cell_carcinoma, urothelial_carcinoma, renal_cell_carcinoma, hepatocellular_carcinoma, small_cell_carcinoma, non_small_cell_carcinoma, carcinoma_other, mesothelioma, melanoma, neuroendocrine, carcinoid, sarcoma_nos, gastrointestinal_stromal_tumour, osteosarcoma, chondrosarcoma, ewing_sarcoma, rhabdomyosarcoma, kaposi_sarcoma, soft_tissue_sarcoma, acute_lymphoblastic_leukaemia, acute_myeloid_leukaemia, chronic_lymphocytic_leukaemia, chronic_myeloid_leukaemia, hodgkin_lymphoma, non_hodgkin_lymphoma, multiple_myeloma, leukaemia_other, myelodysplastic, glioblastoma, astrocytoma, oligodendroglioma, meningioma, seminoma, teratoma, choriocarcinoma, wilms_tumour, retinoblastoma, hepatoblastoma
MSIStatus msi_high, ms_stable
TMBStatus tmb_high, tmb_low, tmb_intermediate
MolecularBiomarkerType other, braf, ntrk1, ntrk2, ntrk3, ret, erbb2_her2, tp53, brca1, brca2, mlh1, msh2, msh6, pms2, palb2, rad51, egfr, alk, ros1, met, kras, nras, pik3ca, esr1_er, pgr_pr, ki_67, kit, pdgfra, fgfr1, fgfr2, fgfr3, idh1, idh2, pdl1, nf1, nf2, mgmt, npm1, flt3, bcr_abl1, jak2, bcl2, myc
BiomarkerStatus altered, negative, equivocal, hypothetical
CancerScoreName pathological_grade, gleason, figo, dukes, breslow, clark, binet, child_pugh, other
SpreadType other, lymph_node, liver, lung, spine, other_bone, brain, other_cns, adrenal, kidney, pleura, peritoneum, skin, pancreas, spleen, ovary, testis, thyroid, stomach, bowel, bladder, prostate, breast, head_and_neck
TimelineEventType had_systemic_or_radiotherapy_treatment, had_surgical_treatment_performed, experienced_toxicity_or_complication_related_to_treatment, experienced_treatment_reduction_or_stop, considered_for_clinical_trial, enrolled_to_clinical_trial, positive_treatment_response_on_assessment, evidence_of_metastatic_progression, radiology_evidence_of_disease_progression, experienced_disease_remission, experienced_disease_recurrence, patient_died
PatientFindingType comorbidity_finding, social_or_family_finding, symptom_finding, physical_examination_finding, functional_finding, mental_state_finding
PatientFindingStatus is_present, is_not_present, uncertain
FuturePlanType planned_systemic_or_radiotherapy_treatment, planned_surgery_treatment, planned_investigation, planned_clinical_trial_involvement

License

This project uses a proprietary license issued by Guy's and St Thomas' NHS Foundation Trust, enabling free (non-commercial) use by NHS organisations. See LICENSE files for details.

Metadata

Release files for londonaicentre-oncoschema 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for londonaicentre-oncoschema 2.1.0
File Size Uploaded
londonaicentre_oncoschema-2.1.0.tar.gz 24.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for londonaicentre-oncoschema 2.1.0
File Interpreter ABI Platform
londonaicentre_oncoschema-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.9 kB

Release files / londonaicentre_oncoschema-2.1.0.tar.gz

Download URL londonaicentre_oncoschema-2.1.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fddd5c23430bfb618eff86b099750b01b4847e47e26018aaf6f0e0b02426ad0f
BLAKE2b-256 checksum
How to use checksums
ed480121db9f51e791354fad7031336236ec70c3f5dbaa8449fe5974b214a2c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / londonaicentre_oncoschema-2.1.0-py3-none-any.whl

Download URL londonaicentre_oncoschema-2.1.0-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16495ff5f2506f8cd6008d99b2a4cd4e1e77976ede93f3b71fddb9001d31073b
BLAKE2b-256 checksum
How to use checksums
71472617cdf8f5e78e3a724ea4b051f6f8558e2bd028fd9d6c30e4d223808362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page