lawhy commited on
Commit
f57c2c8
1 Parent(s): f8c0fde

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -9
README.md CHANGED
@@ -10,6 +10,12 @@ tags:
10
  license: apache-2.0
11
  language:
12
  - en
 
 
 
 
 
 
13
  ---
14
 
15
  # Hierarchy-Transformers/HiT-MiniLM-L12-SnomedCT
@@ -20,15 +26,23 @@ A **Hi**erarchy **T**ransformer Encoder (HiT) model that explicitly encodes enti
20
 
21
  <!-- Provide a longer summary of what this model is. -->
22
 
23
- HiT-MiniLM-L12-SnomedCT is a HiT model trained on the SNOMED CT ontology with random negative sampling.
24
 
25
  - **Developed by:** [Yuan He](https://www.yuanhe.wiki/), Zhangdie Yuan, Jiaoyan Chen, and Ian Horrocks
26
- - **Model type:** Hierarchy Transformer Encoder (HiT)
27
  - **License:** Apache license 2.0
28
- - **Hierarchy**: SNOMED CT
29
- - **Training Dataset**: Download `snomed.zip` from [Datasets for HiTs on Zenodo](https://zenodo.org/doi/10.5281/zenodo.10511042)
30
  - **Pre-trained model:** [sentence-transformers/all-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L12-v2)
31
- - **Training Objectives**: Jointly optimised on *hyperbolic clustering* and *hyperbolic centripetal* losses
 
 
 
 
 
 
 
 
32
 
33
  ### Model Sources
34
 
@@ -58,7 +72,12 @@ gpu_id = 0
58
  device = get_torch_device(gpu_id)
59
 
60
  # load the model
61
- model = HierarchyTransformer.load_pretrained('Hierarchy-Transformers/HiT-MiniLM-L12-SnomedCT', device)
 
 
 
 
 
62
 
63
  # entity names to be encoded.
64
  entity_names = ["computer", "personal computer", "fruit", "berry"]
@@ -86,7 +105,8 @@ parent_norms = model.manifold.dist0(parent_entity_embeddings)
86
  subsumption_scores = - (dists + centri_score_weight * (parent_norms - child_norms))
87
  ```
88
 
89
- Training and evaluation scripts are available at [GitHub](https://github.com/KRR-Oxford/HierarchyTransformers).
 
90
  Technical details are presented in the [paper](https://arxiv.org/abs/2401.11374).
91
 
92
 
@@ -105,7 +125,7 @@ HierarchyTransformer(
105
 
106
  Preprint on arxiv: https://arxiv.org/abs/2401.11374.
107
 
108
- *Yuan He, Zhangdie Yuan, Jiaoyan Chen, Ian Horrocks.* **Language Models as Hierarchy Encoders.** arXiv preprint arXiv:2401.11374 (2024).
109
 
110
  ```
111
  @article{he2024language,
@@ -116,6 +136,7 @@ Preprint on arxiv: https://arxiv.org/abs/2401.11374.
116
  }
117
  ```
118
 
 
119
  ## Model Card Contact
120
 
121
- For any queries or feedback, please contact Yuan He (yuan.he@cs.ox.ac.uk).
 
10
  license: apache-2.0
11
  language:
12
  - en
13
+ metrics:
14
+ - precision
15
+ - recall
16
+ - f1
17
+ base_model:
18
+ - sentence-transformers/all-MiniLM-L12-v2
19
  ---
20
 
21
  # Hierarchy-Transformers/HiT-MiniLM-L12-SnomedCT
 
26
 
27
  <!-- Provide a longer summary of what this model is. -->
28
 
29
+ HiT-MiniLM-L12-SnomedCT is a HiT model trained on SNOMED-CT's concept subsumption hierarchy (TBox).
30
 
31
  - **Developed by:** [Yuan He](https://www.yuanhe.wiki/), Zhangdie Yuan, Jiaoyan Chen, and Ian Horrocks
32
+ - **Model type:** Hierarchy Transformer Encoder (HiT)
33
  - **License:** Apache license 2.0
34
+ - **Hierarchy**: SNOMED-CT (TBox)
35
+ - **Training Dataset**: Download `snomed-mixed.zip` from [Datasets for HiTs on Zenodo](https://zenodo.org/doi/10.5281/zenodo.10511042)
36
  - **Pre-trained model:** [sentence-transformers/all-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L12-v2)
37
+ - **Training Objectives**: Jointly optimised on *Hyperbolic Clustering* and *Hyperbolic Centripetal* losses (see definitions in the [paper](https://arxiv.org/abs/2401.11374))
38
+
39
+ ### Model Versions
40
+
41
+ | **Version** | **Model Revision** | **Note** |
42
+ |------------|---------|----------|
43
+ |v1.0 (Random Negatives)| `main` or `v1-random-negatives`| The variant trained on random negatives, as detailed in the [paper](https://arxiv.org/abs/2401.11374).|
44
+ |v1.0 (Hard Negatives)| `v1-hard-negatives` | The variant trained on hard negatives, as detailed in the [paper](https://arxiv.org/abs/2401.11374). |
45
+
46
 
47
  ### Model Sources
48
 
 
72
  device = get_torch_device(gpu_id)
73
 
74
  # load the model
75
+ revision = "main" # change for a different version
76
+ model = HierarchyTransformer.from_pretrained(
77
+ model_name_or_path='Hierarchy-Transformers/HiT-MiniLM-L12-SnomedCT',
78
+ revision=revision
79
+ device=device
80
+ )
81
 
82
  # entity names to be encoded.
83
  entity_names = ["computer", "personal computer", "fruit", "berry"]
 
105
  subsumption_scores = - (dists + centri_score_weight * (parent_norms - child_norms))
106
  ```
107
 
108
+ Training and evaluation scripts are available at [GitHub](https://github.com/KRR-Oxford/HierarchyTransformers/tree/main/scripts). See `scripts/evaluate.py` for how we determine the hyperparameters on the validation set for subsumption prediction.
109
+
110
  Technical details are presented in the [paper](https://arxiv.org/abs/2401.11374).
111
 
112
 
 
125
 
126
  Preprint on arxiv: https://arxiv.org/abs/2401.11374.
127
 
128
+ *Yuan He, Zhangdie Yuan, Jiaoyan Chen, Ian Horrocks.* **Language Models as Hierarchy Encoders.** To Appear at NeurIPS 2024.
129
 
130
  ```
131
  @article{he2024language,
 
136
  }
137
  ```
138
 
139
+
140
  ## Model Card Contact
141
 
142
+ For any queries or feedback, please contact Yuan He (`yuan.he(at)cs.ox.ac.uk`).