fernandogd commited on
Commit
cb019b0
·
verified ·
1 Parent(s): 830a330

Release CardioBERTa-based clinical concept disambiguation model

Browse files
README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - it
4
+ library_name: transformers
5
+ pipeline_tag: feature-extraction
6
+ base_model: DT4H/CardioBERTa.it
7
+ tags:
8
+ - biomedical
9
+ - clinical
10
+ - cardiology
11
+ - entity-linking
12
+ - concept-normalization
13
+ - umls
14
+ - metric-learning
15
+ ---
16
+
17
+ # DT4H_CardioBERTa_it_enriched
18
+
19
+ `DT4H_CardioBERTa_it_enriched` is a Italian biomedical terminology encoder for **clinical concept normalization and entity linking**. It is initialized from [`DT4H/CardioBERTa.it`] and specialized using CUI-supervised terminology pairs and metric learning.
20
+
21
+ ## Backbone
22
+
23
+ The backbone belongs to the **CardioBERTa** family from *CardioLM - a multilingual suite of small language models for the cardiology domain*. CardioBERTa comprises language-specific encoder models adapted to cardiology through continued pretraining on monolingual biomedical and cardiology-related corpora using Masked Language Modeling (MLM). The family covers Czech, Dutch, English, Italian, Romanian, Spanish and Swedish.
24
+
25
+ ## Training
26
+
27
+ | | |
28
+ |---|---|
29
+ | Language | Italian (`it`) |
30
+ | Triplet collection | `enriched` |
31
+ | Strategy | `synonyms` |
32
+ | Objective | Multi-Similarity Loss |
33
+ | Mining | All triplets, margin 0.2 |
34
+ | Pooling | CLS |
35
+ | Epochs | 1 |
36
+ | Batch size | 256 |
37
+ | Learning rate | 2e-5 |
38
+ | Max. length | 25 |
39
+
40
+ CUI-supervised synonym pairs.
41
+
42
+ ### Terminology statistics
43
+
44
+ | Strategy | Triplets | CUIs | Unique terms | Unique positives | Terms/CUI | Δ terms |
45
+ |---|---:|---:|---:|---:|---:|---:|
46
+ | synonyms | 69,631 | 69,631 | 136,720 | 69,113 | 2.00 | 0 |
47
+ | parents | 1,597,673 | 476,349 | 529,199 | 414,377 | 3.93 | +392,479 |
48
+ | grandparents | 4,714,271 | 476,970 | 529,487 | 461,831 | 9.83 | +392,767 |
49
+
50
+ This model uses **69,631 triplets**, covering **69,631 CUIs** and **136,720 unique normalized terms**.
51
+
52
+ The training terminology is **not distributed** with this repository because it contains resources subject to UMLS licensing conditions. Only aggregate statistics are released.
53
+
54
+ ## Intended use
55
+
56
+ The model is intended for terminology embedding, biomedical candidate retrieval, concept normalization and entity linking, particularly in cardiology and clinical NLP pipelines. It is not intended for direct clinical decision-making.
57
+
58
+ ## Usage
59
+
60
+ ```python
61
+ import torch
62
+ import torch.nn.functional as F
63
+ from transformers import AutoModel, AutoTokenizer
64
+
65
+ model_id = "DT4H/DT4H_CardioBERTa_it_enriched"
66
+
67
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
68
+ model = AutoModel.from_pretrained(model_id)
69
+
70
+ inputs = tokenizer(
71
+ "clinical concept",
72
+ return_tensors="pt",
73
+ truncation=True,
74
+ max_length=25,
75
+ )
76
+
77
+ with torch.no_grad():
78
+ output = model(**inputs)
79
+
80
+ embedding = F.normalize(
81
+ output.last_hidden_state[:, 0, :],
82
+ p=2,
83
+ dim=1,
84
+ )
85
+ ```
86
+
87
+ ## Reference
88
+
89
+ **Danu et al.** *CardioLM - a multilingual suite of small language models for the cardiology domain*.
90
+
91
+ Developed within the **DataTools4Heart (DT4H)** project, Grant Agreement 101057849.
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/mnt/home/users/gaias_001_uma/fgd/SapBERT/models/baseline/CardioBERTa.it",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.48.0",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 31102
25
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2fdd3ad0b6425c53688535adf65ef955710974bb55ae2c058f0f096ac664249
3
+ size 439733088
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "101": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "102": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "103": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "104": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": false,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "max_len": 512,
51
+ "model_max_length": 512,
52
+ "never_split": null,
53
+ "pad_token": "[PAD]",
54
+ "sep_token": "[SEP]",
55
+ "strip_accents": null,
56
+ "tokenize_chinese_chars": true,
57
+ "tokenizer_class": "BertTokenizer",
58
+ "truncation": true,
59
+ "unk_token": "[UNK]"
60
+ }
training_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "language": "it",
3
+ "strategy": "synonyms",
4
+ "triplets_type": "enriched",
5
+ "backbone": "DT4H/CardioBERTa.it",
6
+ "training": {
7
+ "objective": "Multi-Similarity Loss",
8
+ "pairwise": true,
9
+ "miner": {
10
+ "enabled": true,
11
+ "type_of_triplets": "all",
12
+ "margin": 0.2
13
+ },
14
+ "pooling": "cls",
15
+ "epochs": 1,
16
+ "batch_size": 256,
17
+ "learning_rate": 2e-05,
18
+ "max_length": 25,
19
+ "random_seed": 33
20
+ },
21
+ "training_data_availability": "Training terminology is not redistributed because it contains resources subject to UMLS licensing conditions."
22
+ }
training_data_stats.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "triplets": 69631,
3
+ "malformed_rows": 0,
4
+ "unique_triplets": 69631,
5
+ "duplicate_triplets": 0,
6
+ "unique_cuis": 69631,
7
+ "unique_anchors": 68572,
8
+ "unique_positives": 69113,
9
+ "unique_terms": 136720,
10
+ "unique_anchor_positive_pairs": 69538,
11
+ "ambiguous_terms_across_cuis": 2244,
12
+ "self_pairs_exact": 0,
13
+ "self_pairs_normalized": 185,
14
+ "cuis_with_multiple_terms": 69446,
15
+ "terms_per_cui_mean": 1.9973431373957002,
16
+ "terms_per_cui_median": 2,
17
+ "terms_per_cui_p95": 2.0,
18
+ "terms_per_cui_max": 2,
19
+ "triplets_per_cui_mean": 1,
20
+ "triplets_per_cui_median": 1,
21
+ "triplets_per_cui_p95": 1.0,
22
+ "triplets_per_cui_max": 1,
23
+ "anchor_words_mean": 5.925406787206848,
24
+ "positive_words_mean": 6.174950812138272,
25
+ "cuis_common_with_synonyms": 69631,
26
+ "cuis_added_vs_synonyms": 0,
27
+ "cuis_missing_vs_synonyms": 0,
28
+ "terms_common_with_synonyms": 136720,
29
+ "terms_added_vs_synonyms": 0,
30
+ "terms_missing_vs_synonyms": 0
31
+ }
triplet_comparison.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ strategy,triplets,unique_triplets,unique_cuis,unique_anchors,unique_positives,unique_terms,unique_anchor_positive_pairs,terms_per_cui_mean,terms_per_cui_median,cuis_added_vs_synonyms,cuis_missing_vs_synonyms,terms_added_vs_synonyms,terms_missing_vs_synonyms
2
+ synonyms,69631,69631,69631,68572,69113,136720,69538,1.9973431373957002,2,0,0,0,0
3
+ parents,1597673,1596913,476349,380100,414377,529199,1580295,3.927168945458057,3,406718,0,392479,0
4
+ grandparents,4714271,4712493,476970,450416,461831,529487,4654414,9.828039499339582,7.0,407339,0,392767,0
vocab.txt ADDED
The diff for this file is too large to render. See raw diff