PeteBleackley commited on
Commit
7abf6f6
·
verified ·
1 Parent(s): 9f5c6cd

End of training

Browse files
Files changed (3) hide show
  1. DisamBertSingleSense.py +7 -1
  2. README.md +16 -16
  3. 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, ontology: Generator[LexicalExample], device:torch.device):
 
 
 
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.8247
26
- - Precision: 0.7569
27
- - Recall: 0.7432
28
- - F1: 0.7500
29
- - Matthews: 0.7427
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 | 81.7936 | 0.4396 | 0.3681 | 0.4007 | 0.3673 |
62
- | 0.5564 | 1.0 | 28027 | 0.8047 | 0.7521 | 0.7485 | 0.7503 | 0.7480 |
63
- | 0.4256 | 2.0 | 56054 | 1.0294 | 0.7659 | 0.7590 | 0.7624 | 0.7585 |
64
- | 0.2639 | 3.0 | 84081 | 1.6682 | 0.7656 | 0.7480 | 0.7567 | 0.7475 |
65
- | 0.1907 | 4.0 | 112108 | 3.4982 | 0.7703 | 0.7498 | 0.7599 | 0.7493 |
66
- | 0.0368 | 5.0 | 140135 | 5.1443 | 0.7635 | 0.7458 | 0.7546 | 0.7453 |
67
- | 0.0382 | 6.0 | 168162 | 6.3556 | 0.7674 | 0.7463 | 0.7567 | 0.7458 |
68
- | 0.0172 | 7.0 | 196189 | 8.0398 | 0.7548 | 0.7410 | 0.7479 | 0.7405 |
69
- | 0.0172 | 8.0 | 224216 | 7.1042 | 0.7605 | 0.7467 | 0.7536 | 0.7462 |
70
- | 0.0113 | 9.0 | 252243 | 7.6688 | 0.7624 | 0.7467 | 0.7545 | 0.7462 |
71
- | 0.0064 | 10.0 | 280270 | 7.8247 | 0.7569 | 0.7432 | 0.7500 | 0.7427 |
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:16fa38968a9a12b8f7abd761f6134a5a79193c9984529af17ec8f2117dfc7050
3
  size 596077624
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0e4738031e8de40fca39c5b910e41d301a71d07047dbc0b28893383db23b534
3
  size 596077624