End of training
Browse files- DisamBertSingleSense.py +7 -1
- README.md +16 -16
- model.safetensors +1 -1
DisamBertSingleSense.py
CHANGED
|
@@ -115,13 +115,17 @@ class DisamBertSingleSense(PreTrainedModel):
|
|
| 115 |
|
| 116 |
|
| 117 |
class CandidateLabeller:
|
| 118 |
-
def __init__(self, tokenizer: PreTrainedTokenizer,
|
|
|
|
|
|
|
|
|
|
| 119 |
self.tokenizer = tokenizer
|
| 120 |
self.device = device
|
| 121 |
self.gloss_tokens = {
|
| 122 |
example.concept: self.tokenizer(example.definition, padding=True)
|
| 123 |
for example in ontology
|
| 124 |
}
|
|
|
|
| 125 |
|
| 126 |
def __call__(self, batch: dict) -> dict:
|
| 127 |
with self.device:
|
|
@@ -154,4 +158,6 @@ class CandidateLabeller:
|
|
| 154 |
result["labels"] = torch.tensor(
|
| 155 |
[example["candidates"].index(example["label"]) for example in batch]
|
| 156 |
)
|
|
|
|
|
|
|
| 157 |
return result
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
class CandidateLabeller:
|
| 118 |
+
def __init__(self, tokenizer: PreTrainedTokenizer,
|
| 119 |
+
ontology: Generator[LexicalExample],
|
| 120 |
+
device:torch.device,
|
| 121 |
+
retain_candidates: bool = False):
|
| 122 |
self.tokenizer = tokenizer
|
| 123 |
self.device = device
|
| 124 |
self.gloss_tokens = {
|
| 125 |
example.concept: self.tokenizer(example.definition, padding=True)
|
| 126 |
for example in ontology
|
| 127 |
}
|
| 128 |
+
self.retain_candidates = retain_candidates
|
| 129 |
|
| 130 |
def __call__(self, batch: dict) -> dict:
|
| 131 |
with self.device:
|
|
|
|
| 158 |
result["labels"] = torch.tensor(
|
| 159 |
[example["candidates"].index(example["label"]) for example in batch]
|
| 160 |
)
|
| 161 |
+
if self.retain_candidates:
|
| 162 |
+
result['candidates'] = [example['candidates'] for example in batch]
|
| 163 |
return result
|
README.md
CHANGED
|
@@ -22,11 +22,11 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 22 |
|
| 23 |
This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the semcor dataset.
|
| 24 |
It achieves the following results on the evaluation set:
|
| 25 |
-
- Loss: 7.
|
| 26 |
-
- Precision: 0.
|
| 27 |
-
- Recall: 0.
|
| 28 |
-
- F1: 0.
|
| 29 |
-
- Matthews: 0.
|
| 30 |
|
| 31 |
## Model description
|
| 32 |
|
|
@@ -58,17 +58,17 @@ The following hyperparameters were used during training:
|
|
| 58 |
|
| 59 |
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Matthews |
|
| 60 |
|:-------------:|:-----:|:------:|:---------------:|:---------:|:------:|:------:|:--------:|
|
| 61 |
-
| No log | 0 | 0 |
|
| 62 |
-
| 0.
|
| 63 |
-
| 0.
|
| 64 |
-
| 0.
|
| 65 |
-
| 0.
|
| 66 |
-
| 0.
|
| 67 |
-
| 0.
|
| 68 |
-
| 0.
|
| 69 |
-
| 0.
|
| 70 |
-
| 0.
|
| 71 |
-
| 0.
|
| 72 |
|
| 73 |
|
| 74 |
### Framework versions
|
|
|
|
| 22 |
|
| 23 |
This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the semcor dataset.
|
| 24 |
It achieves the following results on the evaluation set:
|
| 25 |
+
- Loss: 7.9132
|
| 26 |
+
- Precision: 0.7725
|
| 27 |
+
- Recall: 0.7594
|
| 28 |
+
- F1: 0.7659
|
| 29 |
+
- Matthews: 0.7589
|
| 30 |
|
| 31 |
## Model description
|
| 32 |
|
|
|
|
| 58 |
|
| 59 |
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Matthews |
|
| 60 |
|:-------------:|:-----:|:------:|:---------------:|:---------:|:------:|:------:|:--------:|
|
| 61 |
+
| No log | 0 | 0 | 83.4924 | 0.4375 | 0.3642 | 0.3975 | 0.3634 |
|
| 62 |
+
| 0.4971 | 1.0 | 28027 | 0.7339 | 0.7793 | 0.7669 | 0.7730 | 0.7664 |
|
| 63 |
+
| 0.3296 | 2.0 | 56054 | 0.9845 | 0.7756 | 0.7656 | 0.7705 | 0.7651 |
|
| 64 |
+
| 0.1843 | 3.0 | 84081 | 2.0537 | 0.7743 | 0.7616 | 0.7679 | 0.7611 |
|
| 65 |
+
| 0.0903 | 4.0 | 112108 | 3.9497 | 0.7729 | 0.7559 | 0.7643 | 0.7554 |
|
| 66 |
+
| 0.0171 | 5.0 | 140135 | 5.8641 | 0.7727 | 0.7555 | 0.7640 | 0.7550 |
|
| 67 |
+
| 0.0394 | 6.0 | 168162 | 6.5708 | 0.7747 | 0.7555 | 0.7650 | 0.7550 |
|
| 68 |
+
| 0.0011 | 7.0 | 196189 | 7.4188 | 0.7705 | 0.7550 | 0.7627 | 0.7545 |
|
| 69 |
+
| 0.0231 | 8.0 | 224216 | 7.0225 | 0.7762 | 0.7621 | 0.7691 | 0.7615 |
|
| 70 |
+
| 0.0015 | 9.0 | 252243 | 6.9004 | 0.7766 | 0.7599 | 0.7681 | 0.7594 |
|
| 71 |
+
| 0.0000 | 10.0 | 280270 | 7.9132 | 0.7725 | 0.7594 | 0.7659 | 0.7589 |
|
| 72 |
|
| 73 |
|
| 74 |
### Framework versions
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 596077624
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0e4738031e8de40fca39c5b910e41d301a71d07047dbc0b28893383db23b534
|
| 3 |
size 596077624
|