Views
No views yet
from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
tokenizer = AutoTokenizer.from_pretrained("bvanaken/clinical-assertion-negation-bert")
model = AutoModelForSequenceClassification.from_pretrained("bvanaken/clinical-assertion-negation-bert")
PRESENT(0), ABSENT(1) or POSSIBLE(2). The entity in question is identified with the special token [entity] surrounding it.input = "The patient recovered during the night and now denies any [entity] shortness of breath [entity]."
classifier = TextClassificationPipeline(model=model, tokenizer=tokenizer)
classification = classifier(input)
# [{'label': 'ABSENT', 'score': 0.9842607378959656}]1@inproceedings{van-aken-2021-assertion,
2 title = "Assertion Detection in Clinical Notes: Medical Language Models to the Rescue?",
3 author = "van Aken, Betty and
4 Trajanovska, Ivana and
5 Siu, Amy and
6 Mayrdorfer, Manuel and
7 Budde, Klemens and
8 Loeser, Alexander",
9 booktitle = "Proceedings of the Second Workshop on Natural Language Processing for Medical Conversations",
10 year = "2021",
11 address = "Online",
12 publisher = "Association for Computational Linguistics",
13 url = "https://aclanthology.org/2021.nlpmc-1.5",
14 doi = "10.18653/v1/2021.nlpmc-1.5"
15}