Skip to main content

rad-metric

Composite metrics for chest X-ray report (CXR) generation with minimal dependencies and no version caps on pytroch/transformers.

Supported metrics:

  • BLEU
  • BertScore
  • SembScore
  • CheXbert
  • RadGraph
  • RaTEScore

Major dependencies (will be handled by pip)

pytorch>=2.1
transformers>=4.39.0
ray

Setup

pip install rad-metric

Usage

We use ray to initialize the evaluation workers, CPU for BLEU and GPU for the rest. By default, it will use all the available GPU devices in the current machine. If you want to run this metric software on multi-node cluster, initialize ray yourself and add more nodes as you need.

Refer to example.py for example usages.

Reference

Please prioritize to cite the original contributors of each metric.

BLEU:

@inproceedings{bleu02,
  year = {2002},
  url = {https://doi.org/10.3115/1073083.1073135},
  author = {Papineni, Kishore and Roukos, Salim and Ward, Todd and Zhu, Wei-Jing},
  booktitle = {Annual Meeting of the Association for Computational Linguistics (ACL)},
  title = {{{BLEU}}: A Method for Automatic Evaluation of Machine Translation}
}

RadGraph

@inproceedings{jainRadGraphExtractingClinical2021,
  year = {2021},
  url = {https://doi.org/10.48550/arXiv.2106.14463},
  author = {Jain, Saahil and Agrawal, Ashwin and Saporta, Adriel and Truong, Steven QH and Duong, Du Nguyen and Bui, Tan and Chambon, Pierre and Zhang, Yuhao and Lungren, Matthew P. and Ng, Andrew Y. and Langlotz, Curtis P. and Rajpurkar, Pranav},
  booktitle = {Conference on Neural Information Processing Systems (NeurIPS)},
  title = {{{RadGraph}}: {{Extracting Clinical Entities}} and {{Relations}} from {{Radiology Reports}}}
}

SembScore and F1CheXbert

@inproceedings{smitCheXbertCombiningAutomatic2020,
  year = {2020},
  url = {https://doi.org/10.48550/arXiv.2004.09167},
  author = {Smit, Akshay and Jain, Saahil and Rajpurkar, Pranav and Pareek, Anuj and Ng, Andrew Y. and Lungren, Matthew P.},
  booktitle = {Conference on Empirical Methods in Natural Language Processing (EMNLP)},
  title = {{{CheXbert}}: {{Combining Automatic Labelers}} and {{Expert Annotations}} for {{Accurate Radiology Report Labeling Using BERT}}}
}

RaTEScore

@inproceedings{zhaoRaTEScoreMetricRadiology2024,
  year = {2024},
  url = {https://doi.org/10.18653/v1/2024.emnlp-main.836},
  author = {Zhao, Weike and Wu, Chaoyi and Zhang, Xiaoman and Zhang, Ya and Wang, Yanfeng and Xie, Weidi},
  booktitle = {Conference on Empirical Methods in Natural Language Processing (EMNLP)},
  title = {{{RaTEScore}}: {{A Metric}} for {{Radiology Report Generation}}}
}

Metadata

Release files for rad-metric 0.1.4

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

Source distribution (sdist)

Source distribution for rad-metric 0.1.4
File Size Uploaded Provenance Actions
rad_metric-0.1.4.tar.gz 8.1 kB Without provenance Details for rad_metric-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rad-metric 0.1.4
File Interpreter ABI Platform Actions
rad_metric-0.1.4-py3-none-any.whl Python 3 none any Details for rad_metric-0.1.4-py3-none-any.whl

Total release size: 19.4 kB

Release files / rad_metric-0.1.4.tar.gz

Download URL rad_metric-0.1.4.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
80fc12f13116f71b4615cc3f51aa8fd5c6b3ed877f37bc0a869b3544d5b26ee3
BLAKE2b-256 checksum
How to use checksums
8d697eb69bdb26638e52c4dd36155a1ef7009e6775a13c2a82fdd76121b783f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / rad_metric-0.1.4-py3-none-any.whl

Download URL rad_metric-0.1.4-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89719d24fd94d230c00eb251624409a2c4c5f0b884d2488234df4657371872f1
BLAKE2b-256 checksum
How to use checksums
457fb640fc88312f7885a900dfee7821ec9043d05fee65af076aedff2fe428a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Security for rad-metric 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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