Views
No views yet
1import torch
2from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
4tokenizer = AutoTokenizer.from_pretrained("ltg/norbert3-fine-absa-full")
5model = AutoModelForSequenceClassification.from_pretrained("ltg/norbert3-fine-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# -> ['ppr_pos', 'wtp_neg'] (patient-provider/staff relationships:positive, waiting time for appointment:negative)
24| Aspect | NorPaCabsa | GP | SMH | ||||
|---|---|---|---|---|---|---|---|
| Full name | Short-name | # | % | # | % | # | % |
| Healthcare providers and staff | |||||||
| Competence of providers | cp | 401 | 7.2 | 247 | 8.9 | 154 | 5.5 |
| Information sharing with patients | isp | 88 | 1.6 | 44 | 1.6 | 44 | 1.6 |
| Language | lang | 13 | 0.2 | 12 | 0.4 | 1 | 0.1 |
| Patient–provider/staff relationships | ppr | 917 | 16.5 | 412 | 14.9 | 505 | 18.0 |
| Time Spent with healthcare Professionals | tshp | 265 | 4.8 | 102 | 3.7 | 163 | 5.8 |
| Organization of health services | |||||||
| External cooperation with other services | excos | 128 | 2.3 | 100 | 3.6 | 28 | 1.0 |
| Internal cooperation and communication | incc | 30 | 0.5 | 10 | 0.4 | 20 | 0.7 |
| Structure and routines | sr | 167 | 3.0 | 58 | 2.1 | 109 | 3.9 |
| System-level organization of health services | slohs | 193 | 3.5 | 101 | 3.7 | 92 | 3.3 |
| Duration of treatment and stays | dur | 77 | 1.4 | – | – | 77 | 2.8 |
| Access and availability | |||||||
| Geographical distance to GP office | gd | 19 | 0.3 | 19 | 0.7 | – | – |
| Telephone and digital communication | td | 181 | 3.3 | 181 | 6.6 | – | – |
| Waiting times in clinic | wtc | 54 | 1.0 | 54 | 2.0 | – | – |
| Waiting time for appointment | wtp | 121 | 2.2 | 121 | 4.4 | – | – |
| Workload | wol | 66 | 1.2 | 66 | 2.4 | – | – |
| Environment and facilities | |||||||
| Physical and psychosocial environment | ppe | 110 | 2.0 | 16 | 0.6 | 94 | 3.4 |
| Activities | act | 113 | 2.0 | – | – | 113 | 4.0 |
| Interaction with other patients | iop | 51 | 0.9 | – | – | 51 | 1.8 |
| Quality of food and meal routines | qfm | 90 | 1.6 | – | – | 90 | 3.2 |
| Treatment | |||||||
| Medication | med | 106 | 1.9 | 35 | 1.3 | 71 | 2.5 |
| Stability and continuity in treatment | sct | 482 | 8.7 | 392 | 14.2 | 90 | 3.2 |
| Forced treatment / coercion | ftc | 36 | 0.7 | – | – | 36 | 1.3 |
| Uncategorized / Top-level aspects | |||||||
| Outcome and impact of treatment / stay | oits | 319 | 5.7 | – | – | 319 | 11.4 |
| Patient involvement and participation | pip | 68 | 1.2 | – | – | 68 | 2.4 |
| General | gen | 1376 | 24.7 | 727 | 26.3 | 649 | 23.2 |
| No aspect / Neutral | no-asp | 92 | 1.7 | 64 | 2.3 | 28 | 1.0 |
| Total | 5563 | 100.0 | 2761 | 100.0 | 2802 | 100.0 |
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}