Skip to main content

Medical Concept Annotation Toolkit (v2)

Project description

Medical oncept Annotation Tool (version 2)

MedCAT can be used to extract information from Electronic Health Records (EHRs) and link it to biomedical ontologies like SNOMED-CT, UMLS, or HPO (and potentially other ontologies). Original paper for v1 on arXiv.

There's a number of breaking changes in MedCAT v2 compared to v1. When moving from v1 to v2, please refer to the migration guide. Details on breaking are outlined here.

Build Status Documentation Status Latest release

Official Docs here

Discussion Forum discourse

Available Models

We have 2 public v2 models available:

  1. SnomedCT UK Clinical edition 39.0 (Oct 2024) and UK Drug Extension 39.0 (July 2024) based model enriched with UMLS 2024AA; trained only on MIMIC-IV
  2. SnomedCT UK Clinical edition 40.2 (June 2025) and UK Drug Extension 40.3 (July 2024) based model enriched with UMLS 2024AA; trained only on MIMIC-IV

We also have a number of MedCAT v1 models available:

  1. UMLS Small (A modelpack containing a subset of UMLS (disorders, symptoms, medications...). Trained on MIMIC-III)
  2. SNOMED International (Full SNOMED modelpack trained on MIMIC-III)
  3. UMLS Dutch v1.10 (a modelpack provided by UMC Utrecht containing UMLS entities with Dutch names trained on Dutch medical wikipedia articles and a negation detection model repository/paper trained on EMC Dutch Clinical Corpus).
  4. UMLS Full. >4MM concepts trained self-supervised on MIMIC-III. v2022AA of UMLS.
  5. The same 2024 based model as above in v1 format
  6. The same 2025 based model as above in v1 format

To download any of these models, please follow this link (or this link for API key based download) and sign into your NIH profile / UMLS license. You will then be redirected to the MedCAT model download form. Please complete this form and you will be provided a download link.

While we encourage you use MedCAT v2 and the models in that native format, if you download an older version MedCAT v2 will be able to load it and covnert it to the format it knows. However, the loading process will be considerably longerin those cases.

If you wish you can also convert the v1 models into the v2 format (see tutorial).

from medcat.utils.legacy import legacy_converter
from medcat.storage.serialisers import AvailableSerialisers
old_model = '<path to old v1 model>'
new_model_dir = '<dir to place new model in>'
legacy_converter.do_conversion(old_model_path, new_model_dir, AvailableSerialisers.dill)

OR

model_path = "models/medcat1_model_pack.zip"
new_model_folder = "models"  # file in this folder
! python -m  medcat.utils.legacy.legacy_converter $model_path $new_model_folder --verbose

News

  • New public 2024 and 2025 Snomed models were uploaded and made available 7. October 2025.
  • MedCAT 2.0.0 was released 18. August 2025.

Installation

MedCAT v2 has its first full release

pip install medcat

Do note that this installs only the core MedCAT v2. It does not necessary dependencies for spacy-based tokenizing or MetaCATs or DeID. However, all of those are supported as well. You can install them as follows:

pip install "medcat[spacy]" # for spacy-based tokenizer
pip install "medcat[meta-cat]"  # for MetaCAT
pip install "medcat[deid]"  # for DeID models
pip install "medcat[spacy,meta-cat,deid,rel-cat,dict-ner]"  # for all of the above

Version / update checking

MedCAT now has the ability to check for newer versions of itself on PyPI (or a local mirror of it). This is so users don't get left behind too far with older versions of our software. This is configurable by evnironmental variables so that sys admins (e.g for JupyterHub) can specify the settings they wish. Version checks are done once a week and the results are cached.

Below is a table of the environmental variables that govern the version checking and their defaults.

Variable Default Description
MEDCAT_DISABLE_VERSION_CHECK (unset) When set to true, yes or disable, disables the version update check entirely. Useful for CI environments, offline setups, or deployments where external network access is restricted.
MEDCAT_PYPI_URL https://pypi.org/pypi Base URL used to query package metadata. Can be changed to a PyPI mirror or internal repository that exposes the /pypi/{pkg}/json API.
MEDCAT_MINOR_UPDATE_THRESHOLD 3 Number of newer minor versions (e.g. 1.4.x, 1.5.x) that must exist before MedCAT emits a “newer version available” log message.
MEDCAT_PATCH_UPDATE_THRESHOLD 3 Number of newer patch versions (e.g. 1.3.1, 1.3.2, 1.3.3) on the same minor line required before emitting an informational update message.
MEDCAT_VERSION_UPDATE_LOG_LEVEL INFO Logging level used when reporting available newer versions (minor/patch thresholds). Accepts any valid logging level string (DEBUG, INFO, WARNING, ERROR, CRITICAL).
MEDCAT_VERSION_UPDATE_YANKED_LOG_LEVEL WARNING Logging level used when reporting that the current version has been yanked on PyPI. Accepts the same values as above.

Demo

The MedCAT v2 demo web app is available here.

Key Concepts

  • Components: The building blocks of MedCAT (NER, Entity Linking, preprocessing, etc.)
  • Addons: Components that extend the core NER+EL pipeline with additional processing stages
  • Plugins: External packages that provide new component implementations or other functionality via entry points

See Architecture Documentation for detailed information.

Tutorials

A guide on how to use MedCAT v2 is available at MedCATv2 Tutorials. However, the tutorials are a bit of a work in progress at this point in time.

Acknowledgements

Entity extraction was trained on MedMentions In total it has ~ 35K entites from UMLS

The vocabulary was compiled from Wiktionary In total ~ 800K unique words

Powered By

A big thank you goes to spaCy and Hugging Face - who made life a million times easier.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

medcat-2.5.3.tar.gz (77.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

medcat-2.5.3-py3-none-any.whl (307.8 kB view details)

Uploaded Python 3

File details

Details for the file medcat-2.5.3.tar.gz.

File metadata

  • Download URL: medcat-2.5.3.tar.gz
  • Upload date:
  • Size: 77.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for medcat-2.5.3.tar.gz
Algorithm Hash digest
SHA256 de4b8a1e74f22086c0b9763278ac96ec3f8f3b7be607f52506a8df5513204768
MD5 cba6280cc7ee527b591ff9ebcee78b7a
BLAKE2b-256 fddb7e707e7d59dd96da3cdfaf1ef227700cabfa0d9fd89fd2742f579811c02c

See more details on using hashes here.

Provenance

The following attestation bundles were made for medcat-2.5.3.tar.gz:

Publisher: medcat-v2_release.yml on CogStack/cogstack-nlp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file medcat-2.5.3-py3-none-any.whl.

File metadata

  • Download URL: medcat-2.5.3-py3-none-any.whl
  • Upload date:
  • Size: 307.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for medcat-2.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 00cacfedde070c478be4614f5cfc7356bdabda1021ec1eef33c59b62e57e9762
MD5 c3511ee49b9829c206687ba20e806b8f
BLAKE2b-256 cd8321276e6211c607f577bb6eef9a90605cd0c1833e7479d031cf4a76ac2ef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for medcat-2.5.3-py3-none-any.whl:

Publisher: medcat-v2_release.yml on CogStack/cogstack-nlp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page