Upload folder using huggingface_hub
Browse files- README.md +54 -52
- pytorch_model.bin +1 -1
README.md
CHANGED
@@ -1,72 +1,74 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
3 |
tags:
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
-
|
8 |
-
|
9 |
-
-
|
10 |
-
|
11 |
-
|
12 |
-
|
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-focal_loss
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
## Model description
|
29 |
|
30 |
-
More information needed
|
31 |
|
32 |
-
|
33 |
|
34 |
-
|
35 |
|
36 |
-
## Training and evaluation data
|
37 |
|
38 |
-
More information needed
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
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 |
-
|
55 |
|
56 |
-
|
57 |
-
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
|
58 |
-
| 0.1571 | 1.0 | 78 | 0.1334 | 0.5761 | 0.5597 | 0.5846 | 0.5761 |
|
59 |
-
| 0.1019 | 2.0 | 156 | 0.1009 | 0.6472 | 0.6399 | 0.6660 | 0.6472 |
|
60 |
-
| 0.0711 | 3.0 | 234 | 0.0923 | 0.6861 | 0.6869 | 0.6910 | 0.6861 |
|
61 |
-
| 0.0475 | 4.0 | 312 | 0.0972 | 0.6602 | 0.6611 | 0.6746 | 0.6602 |
|
62 |
-
| 0.0258 | 5.0 | 390 | 0.1085 | 0.6602 | 0.6596 | 0.6699 | 0.6602 |
|
63 |
-
| 0.0188 | 6.0 | 468 | 0.1099 | 0.6634 | 0.6626 | 0.6667 | 0.6634 |
|
64 |
-
| 0.0155 | 7.0 | 546 | 0.1136 | 0.6602 | 0.6596 | 0.6642 | 0.6602 |
|
65 |
|
|
|
66 |
|
67 |
-
|
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-focal_loss")
|
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:
|
3 |
size 438038894
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89a4316b804c5a8cb4debd7db680a72c6c626be8a99d7e09a6b092e97660e359
|
3 |
size 438038894
|