Views
No views yet
1import torch
2from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
4tokenizer = AutoTokenizer.from_pretrained("ltg/norbert3-coarse-absa-full")
5model = AutoModelForSequenceClassification.from_pretrained("ltg/norbert3-coarse-absa-full", trust_remote_code=True)
6
7model.eval()
8
9text = "fastlegen lytter til meg, men jeg synes ventetiden er for lang."
10
11# tokenize input
12inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
13
14# Run inference
15with torch.no_grad():
16 outputs = model(**inputs)
17
18# Get predictions
19threshold = 0.5
20probs = torch.sigmoid(outputs.logits).squeeze()
21predictions = [model.config.id2label[i] for i, prob in enumerate(probs) if prob > threshold]
22print(predictions)
23# -> ['staff_pos', 'avail_neg'] (healthcare providers and staff:positive, access and availability:negative)
24| Aspect full name | Short-name | Instances |
|---|---|---|
| Healthcare providers and staff | staff | 1169 |
| Organization of health services | org | 502 |
| Access and availability | avail | 353 |
| Environment and facilities | env | 286 |
| Treatment | treat | 591 |
| Uncategorized / Top-level aspects | ||
| Outcome and impact of treatment / stay | oits | 319 |
| Patient involvement and participation | pip | 68 |
| General | gen | 1376 |
| No aspect / Neutral | no-asp | 92 |
| Total | 4756 |
1@inproceedings{storset-etal-2026-pain,
2 title = "From Pain to Praise: Aspect-Based Sentiment Analysis for {N}orwegian Patient Feedback",
3 author = "Storset, Lilja Charlotte and
4 Jelin, Elma and
5 Norman, Rebecka Maria and
6 Bjertnaes, Oyvind and
7 {\O}vrelid, Lilja and
8 Velldal, Erik",
9 editor = {Danilova, Vera and
10 Kurfal{\i}, Murathan and
11 S{\"o}derfeldt, Ylva and
12 Reed, Julia and
13 Burchell, Andrew},
14 booktitle = "Proceedings of the 1st Workshop on Linguistic Analysis for Health ({H}ea{L}ing 2026)",
15 month = mar,
16 year = "2026",
17 address = "Rabat, Morocco",
18 publisher = "Association for Computational Linguistics",
19 url = "https://aclanthology.org/2026.healing-1.16/",
20 doi = "10.18653/v1/2026.healing-1.16",
21 pages = "191--202",
22 ISBN = "979-8-89176-367-8",
23 abstract = "This paper describes a new dataset for aspect-based sentiment analysis (ABSA) for analyzing patient feedback about healthcare services. In an interdisciplinary collaboration spanning the fields of natural language processing and healthcare research, we manually annotate a dataset of 2382 free-text comments collected from national patient experience surveys in Norway, covering two sub-fields of services {--} special mental healthcare and general practitioners. Annotations are provided on both the sentence- and comment-level, covering a fine-grained set of 25 unique healthcare-related aspects and their polarities. We also report results for fine-tuning both encoder- and decoder models on the resulting dataset, comparing different modeling strategies, like joint and sequential prediction of aspects and polarity. The resources developed in this work can assist healthcare researchers in the analysis of patient feedback, bringing a much more efficient approach compared to today{'}s manual analysis, potentially leading to improved patient satisfaction and clinical outcomes."
24}