minoosh commited on
Commit
080233b
·
verified ·
1 Parent(s): 1c77597

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +54 -52
  2. pytorch_model.bin +1 -1
README.md CHANGED
@@ -1,72 +1,74 @@
1
  ---
2
- library_name: transformers
 
 
3
  tags:
4
- - generated_from_trainer
5
- metrics:
6
- - accuracy
7
- - f1
8
- - precision
9
- - recall
10
- model-index:
11
- - name: bert-clf-biencoder-kl_divergence
12
- results: []
13
  ---
14
 
15
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
16
- should probably proofread and complete it, then remove this comment. -->
17
 
18
- # bert-clf-biencoder-kl_divergence
19
 
20
- This model is a fine-tuned version of [](https://huggingface.co/) on an unknown dataset.
21
- It achieves the following results on the evaluation set:
22
- - Loss: 0.9469
23
- - Accuracy: 0.6828
24
- - F1: 0.6844
25
- - Precision: 0.6937
26
- - Recall: 0.6828
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- ## Model description
29
 
30
- More information needed
31
 
32
- ## Intended uses & limitations
33
 
34
- More information needed
35
 
36
- ## Training and evaluation data
37
 
38
- More information needed
39
 
40
- ## Training procedure
41
 
42
- ### Training hyperparameters
43
 
44
- The following hyperparameters were used during training:
45
- - learning_rate: 2e-05
46
- - train_batch_size: 32
47
- - eval_batch_size: 32
48
- - seed: 42
49
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
50
- - lr_scheduler_type: linear
51
- - lr_scheduler_warmup_steps: 100
52
- - num_epochs: 7
53
 
54
- ### Training results
55
 
56
- | Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall |
57
- |:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
58
- | 1.1449 | 1.0 | 78 | 1.0565 | 0.5987 | 0.5820 | 0.6068 | 0.5987 |
59
- | 0.8672 | 2.0 | 156 | 0.8471 | 0.6505 | 0.6449 | 0.6611 | 0.6505 |
60
- | 0.6288 | 3.0 | 234 | 0.8003 | 0.6828 | 0.6858 | 0.6933 | 0.6828 |
61
- | 0.5023 | 4.0 | 312 | 0.8179 | 0.6893 | 0.6911 | 0.7008 | 0.6893 |
62
- | 0.332 | 5.0 | 390 | 0.8610 | 0.6861 | 0.6866 | 0.6907 | 0.6861 |
63
- | 0.2637 | 6.0 | 468 | 0.9075 | 0.6861 | 0.6870 | 0.6890 | 0.6861 |
64
- | 0.1895 | 7.0 | 546 | 0.9469 | 0.6828 | 0.6844 | 0.6937 | 0.6828 |
65
 
 
66
 
67
- ### Framework versions
68
 
69
- - Transformers 4.45.1
70
- - Pytorch 2.4.0
71
- - Datasets 3.0.1
72
- - Tokenizers 0.20.0
 
1
  ---
2
+
3
+ language: en
4
+
5
  tags:
6
+
7
+ - bert
8
+
9
+ - classification
10
+
11
+ - pytorch
12
+
13
+ pipeline_tag: text-classification
14
+
15
  ---
16
 
 
 
17
 
 
18
 
19
+ # BiEncoder Classification Model
20
+
21
+
22
+
23
+ This model is a BiEncoder architecture based on BERT for text pair classification.
24
+
25
+
26
+
27
+ ## Model Details
28
+
29
+ - Base Model: bert-base-uncased
30
+
31
+ - Architecture: BiEncoder with BERT base
32
+
33
+ - Number of classes: 4
34
+
35
+
36
+
37
+ ## Usage
38
+
39
+
40
+
41
+ ```python
42
+
43
+ from transformers import AutoTokenizer
44
+
45
+ import torch
46
+
47
+
48
+
49
+ # Load tokenizer
50
+
51
+ tokenizer = AutoTokenizer.from_pretrained("minoosh/bert-clf-biencoder-kl_divergence")
52
 
 
53
 
 
54
 
55
+ # Load model weights
56
 
57
+ state_dict = torch.load("pytorch_model.bin")
58
 
 
59
 
 
60
 
61
+ # Initialize model (you'll need the BiEncoderModel class)
62
 
63
+ model = BiEncoderModel(
64
 
65
+ base_model=AutoModel.from_pretrained("bert-base-uncased"),
 
 
 
 
 
 
 
 
66
 
67
+ num_classes=4
68
 
69
+ )
 
 
 
 
 
 
 
 
70
 
71
+ model.load_state_dict(state_dict)
72
 
73
+ ```
74
 
 
 
 
 
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1c32eb17b3719edcce121b22008ca5c8e79c2979bbde385c10c8f2d5e892659e
3
  size 438038894
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3d749d79c8e440803ab13eb40191813a36da178c900fdfbab8ca81b071b7447
3
  size 438038894