ncbi / MedCPT-Cross-Encoder

huggingface.co
Total runs: 506.0K
24-hour runs: -4.0K
7-day runs: -28.1K
30-day runs: -37.7K
Model's Last Updated: December 03 2023
text-classification

Introduction of MedCPT-Cross-Encoder

Model Details of MedCPT-Cross-Encoder

Usage: Ranking articles for a given query

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("ncbi/MedCPT-Cross-Encoder")
model = AutoModelForSequenceClassification.from_pretrained("ncbi/MedCPT-Cross-Encoder")

query = "diabetes treatment"

# 6 articles to be ranked for the input query
articles = [
    "Type 1 and 2 diabetes mellitus: A review on current treatment approach and gene therapy as potential intervention. Type 1 and type 2 diabetes mellitus is a serious and lifelong condition commonly characterised by abnormally elevated blood glucose levels due to a failure in insulin production or a decrease in insulin sensitivity and function. [...]",
    "Diabetes mellitus and its chronic complications. Diabetes mellitus is a major cause of morbidity and mortality, and it is a major risk factor for early onset of coronary heart disease. Complications of diabetes are retinopathy, nephropathy, and peripheral neuropathy. [...]",
    "Diagnosis and Management of Central Diabetes Insipidus in Adults. Central diabetes insipidus (CDI) is a clinical syndrome which results from loss or impaired function of vasopressinergic neurons in the hypothalamus/posterior pituitary, resulting in impaired synthesis and/or secretion of arginine vasopressin (AVP). [...]",
    "Adipsic diabetes insipidus. Adipsic diabetes insipidus (ADI) is a rare but devastating disorder of water balance with significant associated morbidity and mortality. Most patients develop the disease as a result of hypothalamic destruction from a variety of underlying etiologies. [...]",
    "Nephrogenic diabetes insipidus: a comprehensive overview. Nephrogenic diabetes insipidus (NDI) is characterized by the inability to concentrate urine that results in polyuria and polydipsia, despite having normal or elevated plasma concentrations of arginine vasopressin (AVP). [...]",
    "Impact of Salt Intake on the Pathogenesis and Treatment of Hypertension. Excessive dietary salt (sodium chloride) intake is associated with an increased risk for hypertension, which in turn is especially a major risk factor for stroke and other cardiovascular pathologies, but also kidney diseases. Besides, high salt intake or preference for salty food is discussed to be positive associated with stomach cancer, and according to recent studies probably also obesity risk. [...]"
]

# combine query article into pairs
pairs = [[query, article] for article in articles]

with torch.no_grad():
    encoded = tokenizer(
        pairs,
        truncation=True,
        padding=True,
        return_tensors="pt",
        max_length=512,
    )

    logits = model(**encoded).logits.squeeze(dim=1)
    
    print(logits)

The output will be

tensor([  6.9363,  -8.2063,  -8.7692, -12.3450, -10.4416, -15.8475])

Higher scores indicate higher relevance.

Acknowledgments

This work was supported by the Intramural Research Programs of the National Institutes of Health, National Library of Medicine.

Disclaimer

This tool shows the results of research conducted in the Computational Biology Branch, NCBI/NLM. The information produced on this website is not intended for direct diagnostic use or medical decision-making without review and oversight by a clinical professional. Individuals should not change their health behavior solely on the basis of information produced on this website. NIH does not independently verify the validity or utility of the information produced by this tool. If you have questions about the information produced on this website, please see a health care professional. More information about NCBI's disclaimer policy is available.

Citation

If you find this repo helpful, please cite MedCPT by:

@article{jin2023medcpt,
  title={MedCPT: Contrastive Pre-trained Transformers with large-scale PubMed search logs for zero-shot biomedical information retrieval},
  author={Jin, Qiao and Kim, Won and Chen, Qingyu and Comeau, Donald C and Yeganova, Lana and Wilbur, W John and Lu, Zhiyong},
  journal={Bioinformatics},
  volume={39},
  number={11},
  pages={btad651},
  year={2023},
  publisher={Oxford University Press}
}

Runs of ncbi MedCPT-Cross-Encoder on huggingface.co

506.0K
Total runs
-4.0K
24-hour runs
-16.8K
3-day runs
-28.1K
7-day runs
-37.7K
30-day runs

More Information About MedCPT-Cross-Encoder huggingface.co Model

More MedCPT-Cross-Encoder license Visit here:

https://choosealicense.com/licenses/public-domain

MedCPT-Cross-Encoder huggingface.co

MedCPT-Cross-Encoder huggingface.co is an AI model on huggingface.co that provides MedCPT-Cross-Encoder's model effect (), which can be used instantly with this ncbi MedCPT-Cross-Encoder model. huggingface.co supports a free trial of the MedCPT-Cross-Encoder model, and also provides paid use of the MedCPT-Cross-Encoder. Support call MedCPT-Cross-Encoder model through api, including Node.js, Python, http.

MedCPT-Cross-Encoder huggingface.co Url

https://huggingface.co/ncbi/MedCPT-Cross-Encoder

ncbi MedCPT-Cross-Encoder online free

MedCPT-Cross-Encoder huggingface.co is an online trial and call api platform, which integrates MedCPT-Cross-Encoder's modeling effects, including api services, and provides a free online trial of MedCPT-Cross-Encoder, you can try MedCPT-Cross-Encoder online for free by clicking the link below.

ncbi MedCPT-Cross-Encoder online free url in huggingface.co:

https://huggingface.co/ncbi/MedCPT-Cross-Encoder

MedCPT-Cross-Encoder install

MedCPT-Cross-Encoder is an open source model from GitHub that offers a free installation service, and any user can find MedCPT-Cross-Encoder on GitHub to install. At the same time, huggingface.co provides the effect of MedCPT-Cross-Encoder install, users can directly use MedCPT-Cross-Encoder installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

MedCPT-Cross-Encoder install url in huggingface.co:

https://huggingface.co/ncbi/MedCPT-Cross-Encoder

Url of MedCPT-Cross-Encoder

MedCPT-Cross-Encoder huggingface.co Url

Provider of MedCPT-Cross-Encoder huggingface.co

ncbi
ORGANIZATIONS

Other API from ncbi

huggingface.co

Total runs: 305
Run Growth: 305
Growth Rate: 100.00%
Updated:May 04 2026
huggingface.co

Total runs: 123
Run Growth: 78
Growth Rate: 63.41%
Updated:June 05 2025
huggingface.co

Total runs: 81
Run Growth: 81
Growth Rate: 100.00%
Updated:May 04 2026
huggingface.co

Total runs: 47
Run Growth: -2
Growth Rate: -4.26%
Updated:March 13 2026
huggingface.co

Total runs: 34
Run Growth: 34
Growth Rate: 100.00%
Updated:May 04 2026
huggingface.co

Total runs: 11
Run Growth: -3
Growth Rate: -27.27%
Updated:March 13 2026
huggingface.co

Total runs: 1
Run Growth: 0
Growth Rate: 0.00%
Updated:August 07 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 07 2026