transformers-sklearn

transformers-sklearn provides an interface to fine-tune and apply transformer models for medical natural language processing tasks including classification, named entity recognition, and regression.


Key Features:

  • Primary methods: Implements the functions fit, score, and predict for training, evaluation, and inference with transformer models.
  • Model configuration: Exposes customizable parameters such as model_name_or_path and model_type for selecting pretrained transformer checkpoints and architectures.
  • Multilingual support: Supports multilingual NLP tasks across different language datasets.
  • Input data handling: Automatically generates required input data formats from annotated corpora.
  • Predefined frameworks and training methods: Provides predefined model frameworks and training methods for common NLP tasks.

Scientific Applications:

  • TrialClassification: Multi-label classification of Chinese medical trial texts, achieving a macro F1 score of 0.8225.
  • BC5CDR: English biomedical named entity recognition, achieving a macro F1 score of 0.8703.
  • DiabetesNER: Chinese diabetes entity recognition, achieving a macro F1 score of 0.6908.
  • BIOSSES: English biomedical sentence similarity estimation, achieving a Pearson correlation of 0.8260.

Methodology:

Implements three Python classes—BERTologyClassifier, BERTologyNERClassifier, and BERTologyRegressor—each providing methods to fine-tune transformer-based models (fit), evaluate performance (score), and predict labels on test data (predict).

Topics

Details

License:
Apache-2.0
Cost:
Free of charge
Tool Type:
command-line tool
Operating Systems:
Mac, Linux, Windows
Programming Languages:
Python
Added:
12/13/2021
Last Updated:
12/13/2021

Operations

Publications

Yang F, Wang X, Ma H, Li J. Transformers-sklearn: a toolkit for medical language understanding with transformer-based models. BMC Medical Informatics and Decision Making. 2021;21(S2). doi:10.1186/s12911-021-01459-0. PMID:34330244. PMCID:PMC8323195.

PMID: 34330244
PMCID: PMC8323195
Funding: - Beijing Natural Science Foundation: Z200016 - Chinese Academy of Medical Sciences: 2018-I2M-AI-016 - National Natural Science Foundation of China: 61906214

Downloads