This a UMCU/CardioBERTa.nl_clinical base model finetuned for span classification. For this model
we used IOB-tagging. Using the IOB-tagging schema facilitates the aggregation of predictions
over sequences. This specific model is trained on a batch of 240 span-labeled documents.
CardioNER model --medication is a muticlass span classification model.
The classes that can be predicted are ['medication'].
The following script converts a string of <512 tokens to a list of span predictions.
1from transformers import pipeline
2
3le_pipe = pipeline('ner',
4 model=model,
5 tokenizer=model, aggregation_strategy="simple",
6 device=-1)
7
8named_ents = le_pipe(SOME_TEXT)
To process a string of arbitrary length you can split the string into sentences or paragraphs
using e.g. pysbd or spacy(sentencizer) and iteratively parse the list of with the span-classification pipe.
For more details about training/eval and other scripts, see CardioNER
github repo.
and for more information on the background, see Datatools4Heart
Huggingface/
Website