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index:
|
5 |
+
- name: relbert/relbert-roberta-large-semeval2012-average-no-mask-prompt-d-nce
|
6 |
+
results:
|
7 |
+
- task:
|
8 |
+
name: Relation Mapping
|
9 |
+
type: sorting-task
|
10 |
+
dataset:
|
11 |
+
name: Relation Mapping
|
12 |
+
args: relbert/relation_mapping
|
13 |
+
type: relation-mapping
|
14 |
+
metrics:
|
15 |
+
- name: Accuracy
|
16 |
+
type: accuracy
|
17 |
+
value: 96.42857142857143
|
18 |
+
- task:
|
19 |
+
name: Analogy Questions (SAT full)
|
20 |
+
type: multiple-choice-qa
|
21 |
+
dataset:
|
22 |
+
name: SAT full
|
23 |
+
args: relbert/analogy_questions
|
24 |
+
type: analogy-questions
|
25 |
+
metrics:
|
26 |
+
- name: Accuracy
|
27 |
+
type: accuracy
|
28 |
+
value: 0.6925133689839572
|
29 |
+
- task:
|
30 |
+
name: Analogy Questions (SAT)
|
31 |
+
type: multiple-choice-qa
|
32 |
+
dataset:
|
33 |
+
name: SAT
|
34 |
+
args: relbert/analogy_questions
|
35 |
+
type: analogy-questions
|
36 |
+
metrics:
|
37 |
+
- name: Accuracy
|
38 |
+
type: accuracy
|
39 |
+
value: 0.6913946587537092
|
40 |
+
- task:
|
41 |
+
name: Analogy Questions (BATS)
|
42 |
+
type: multiple-choice-qa
|
43 |
+
dataset:
|
44 |
+
name: BATS
|
45 |
+
args: relbert/analogy_questions
|
46 |
+
type: analogy-questions
|
47 |
+
metrics:
|
48 |
+
- name: Accuracy
|
49 |
+
type: accuracy
|
50 |
+
value: 0.8037798777098388
|
51 |
+
- task:
|
52 |
+
name: Analogy Questions (Google)
|
53 |
+
type: multiple-choice-qa
|
54 |
+
dataset:
|
55 |
+
name: Google
|
56 |
+
args: relbert/analogy_questions
|
57 |
+
type: analogy-questions
|
58 |
+
metrics:
|
59 |
+
- name: Accuracy
|
60 |
+
type: accuracy
|
61 |
+
value: 0.968
|
62 |
+
- task:
|
63 |
+
name: Analogy Questions (U2)
|
64 |
+
type: multiple-choice-qa
|
65 |
+
dataset:
|
66 |
+
name: U2
|
67 |
+
args: relbert/analogy_questions
|
68 |
+
type: analogy-questions
|
69 |
+
metrics:
|
70 |
+
- name: Accuracy
|
71 |
+
type: accuracy
|
72 |
+
value: 0.6885964912280702
|
73 |
+
- task:
|
74 |
+
name: Analogy Questions (U4)
|
75 |
+
type: multiple-choice-qa
|
76 |
+
dataset:
|
77 |
+
name: U4
|
78 |
+
args: relbert/analogy_questions
|
79 |
+
type: analogy-questions
|
80 |
+
metrics:
|
81 |
+
- name: Accuracy
|
82 |
+
type: accuracy
|
83 |
+
value: 0.6898148148148148
|
84 |
+
- task:
|
85 |
+
name: Lexical Relation Classification (BLESS)
|
86 |
+
type: classification
|
87 |
+
dataset:
|
88 |
+
name: BLESS
|
89 |
+
args: relbert/lexical_relation_classification
|
90 |
+
type: relation-classification
|
91 |
+
metrics:
|
92 |
+
- name: F1
|
93 |
+
type: f1
|
94 |
+
value: 0.9273768268796143
|
95 |
+
- name: F1 (macro)
|
96 |
+
type: f1_macro
|
97 |
+
value: 0.9211786019752478
|
98 |
+
- task:
|
99 |
+
name: Lexical Relation Classification (CogALexV)
|
100 |
+
type: classification
|
101 |
+
dataset:
|
102 |
+
name: CogALexV
|
103 |
+
args: relbert/lexical_relation_classification
|
104 |
+
type: relation-classification
|
105 |
+
metrics:
|
106 |
+
- name: F1
|
107 |
+
type: f1
|
108 |
+
value: 0.8615023474178404
|
109 |
+
- name: F1 (macro)
|
110 |
+
type: f1_macro
|
111 |
+
value: 0.7077498583524542
|
112 |
+
- task:
|
113 |
+
name: Lexical Relation Classification (EVALution)
|
114 |
+
type: classification
|
115 |
+
dataset:
|
116 |
+
name: BLESS
|
117 |
+
args: relbert/lexical_relation_classification
|
118 |
+
type: relation-classification
|
119 |
+
metrics:
|
120 |
+
- name: F1
|
121 |
+
type: f1
|
122 |
+
value: 0.6917659804983749
|
123 |
+
- name: F1 (macro)
|
124 |
+
type: f1_macro
|
125 |
+
value: 0.6746361055952557
|
126 |
+
- task:
|
127 |
+
name: Lexical Relation Classification (K&H+N)
|
128 |
+
type: classification
|
129 |
+
dataset:
|
130 |
+
name: K&H+N
|
131 |
+
args: relbert/lexical_relation_classification
|
132 |
+
type: relation-classification
|
133 |
+
metrics:
|
134 |
+
- name: F1
|
135 |
+
type: f1
|
136 |
+
value: 0.9573624539194547
|
137 |
+
- name: F1 (macro)
|
138 |
+
type: f1_macro
|
139 |
+
value: 0.8730312566461178
|
140 |
+
- task:
|
141 |
+
name: Lexical Relation Classification (ROOT09)
|
142 |
+
type: classification
|
143 |
+
dataset:
|
144 |
+
name: ROOT09
|
145 |
+
args: relbert/lexical_relation_classification
|
146 |
+
type: relation-classification
|
147 |
+
metrics:
|
148 |
+
- name: F1
|
149 |
+
type: f1
|
150 |
+
value: 0.9031651519899718
|
151 |
+
- name: F1 (macro)
|
152 |
+
type: f1_macro
|
153 |
+
value: 0.9025725245537483
|
154 |
+
|
155 |
+
---
|
156 |
+
# relbert/relbert-roberta-large-semeval2012-average-no-mask-prompt-d-nce
|
157 |
+
|
158 |
+
RelBERT fine-tuned from [roberta-large](https://huggingface.co/roberta-large) on
|
159 |
+
[relbert/semeval2012_relational_similarity](https://huggingface.co/datasets/relbert/semeval2012_relational_similarity).
|
160 |
+
Fine-tuning is done via [RelBERT](https://github.com/asahi417/relbert) library (see the repository for more detail).
|
161 |
+
It achieves the following results on the relation understanding tasks:
|
162 |
+
- Analogy Question ([dataset](https://huggingface.co/datasets/relbert/analogy_questions), [full result](https://huggingface.co/relbert/relbert-roberta-large-semeval2012-average-no-mask-prompt-d-nce/raw/main/analogy.json)):
|
163 |
+
- Accuracy on SAT (full): 0.6925133689839572
|
164 |
+
- Accuracy on SAT: 0.6913946587537092
|
165 |
+
- Accuracy on BATS: 0.8037798777098388
|
166 |
+
- Accuracy on U2: 0.6885964912280702
|
167 |
+
- Accuracy on U4: 0.6898148148148148
|
168 |
+
- Accuracy on Google: 0.968
|
169 |
+
- Lexical Relation Classification ([dataset](https://huggingface.co/datasets/relbert/lexical_relation_classification), [full result](https://huggingface.co/relbert/relbert-roberta-large-semeval2012-average-no-mask-prompt-d-nce/raw/main/classification.json)):
|
170 |
+
- Micro F1 score on BLESS: 0.9273768268796143
|
171 |
+
- Micro F1 score on CogALexV: 0.8615023474178404
|
172 |
+
- Micro F1 score on EVALution: 0.6917659804983749
|
173 |
+
- Micro F1 score on K&H+N: 0.9573624539194547
|
174 |
+
- Micro F1 score on ROOT09: 0.9031651519899718
|
175 |
+
- Relation Mapping ([dataset](https://huggingface.co/datasets/relbert/relation_mapping), [full result](https://huggingface.co/relbert/relbert-roberta-large-semeval2012-average-no-mask-prompt-d-nce/raw/main/relation_mapping.json)):
|
176 |
+
- Accuracy on Relation Mapping: 96.42857142857143
|
177 |
+
|
178 |
+
|
179 |
+
### Usage
|
180 |
+
This model can be used through the [relbert library](https://github.com/asahi417/relbert). Install the library via pip
|
181 |
+
```shell
|
182 |
+
pip install relbert
|
183 |
+
```
|
184 |
+
and activate model as below.
|
185 |
+
```python
|
186 |
+
from relbert import RelBERT
|
187 |
+
model = RelBERT("relbert/relbert-roberta-large-semeval2012-average-no-mask-prompt-d-nce")
|
188 |
+
vector = model.get_embedding(['Tokyo', 'Japan']) # shape of (1024, )
|
189 |
+
```
|
190 |
+
|
191 |
+
### Training hyperparameters
|
192 |
+
|
193 |
+
The following hyperparameters were used during training:
|
194 |
+
- model: roberta-large
|
195 |
+
- max_length: 64
|
196 |
+
- mode: average_no_mask
|
197 |
+
- data: relbert/semeval2012_relational_similarity
|
198 |
+
- template_mode: manual
|
199 |
+
- template: I wasn’t aware of this relationship, but I just read in the encyclopedia that <subj> is the <mask> of <obj>
|
200 |
+
- loss_function: nce_logout
|
201 |
+
- temperature_nce_constant: 0.05
|
202 |
+
- temperature_nce_rank: {'min': 0.01, 'max': 0.05, 'type': 'linear'}
|
203 |
+
- epoch: 29
|
204 |
+
- batch: 128
|
205 |
+
- lr: 5e-06
|
206 |
+
- lr_decay: False
|
207 |
+
- lr_warmup: 1
|
208 |
+
- weight_decay: 0
|
209 |
+
- random_seed: 0
|
210 |
+
- exclude_relation: None
|
211 |
+
- n_sample: 640
|
212 |
+
- gradient_accumulation: 8
|
213 |
+
|
214 |
+
The full configuration can be found at [fine-tuning parameter file](https://huggingface.co/relbert/relbert-roberta-large-semeval2012-average-no-mask-prompt-d-nce/raw/main/trainer_config.json).
|
215 |
+
|
216 |
+
### Reference
|
217 |
+
If you use any resource from RelBERT, please consider to cite our [paper](https://aclanthology.org/2021.eacl-demos.7/).
|
218 |
+
|
219 |
+
```
|
220 |
+
|
221 |
+
@inproceedings{ushio-etal-2021-distilling-relation-embeddings,
|
222 |
+
title = "{D}istilling {R}elation {E}mbeddings from {P}re-trained {L}anguage {M}odels",
|
223 |
+
author = "Ushio, Asahi and
|
224 |
+
Schockaert, Steven and
|
225 |
+
Camacho-Collados, Jose",
|
226 |
+
booktitle = "EMNLP 2021",
|
227 |
+
year = "2021",
|
228 |
+
address = "Online",
|
229 |
+
publisher = "Association for Computational Linguistics",
|
230 |
+
}
|
231 |
+
|
232 |
+
```
|