Views
No views yet
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("bvanaken/CORe-clinical-diagnosis-prediction")
model = AutoModelForSequenceClassification.from_pretrained("bvanaken/CORe-clinical-diagnosis-prediction")input = "CHIEF COMPLAINT: Headaches\n\nPRESENT ILLNESS: 58yo man w/ hx of hypertension, AFib on coumadin presented to ED with the worst headache of his life."
tokenized_input = tokenizer(input, return_tensors="pt")
output = model(**tokenized_input)
import torch
predictions = torch.sigmoid(output.logits)
predicted_labels = [model.config.id2label[_id] for _id in (predictions > 0.3).nonzero()[:, 1].tolist()]1@inproceedings{vanaken21,
2 author = {Betty van Aken and
3 Jens-Michalis Papaioannou and
4 Manuel Mayrdorfer and
5 Klemens Budde and
6 Felix A. Gers and
7 Alexander Löser},
8 title = {Clinical Outcome Prediction from Admission Notes using Self-Supervised
9 Knowledge Integration},
10 booktitle = {Proceedings of the 16th Conference of the European Chapter of the
11 Association for Computational Linguistics: Main Volume, {EACL} 2021,
12 Online, April 19 - 23, 2021},
13 publisher = {Association for Computational Linguistics},
14 year = {2021},
15}