Update README.md
Browse files
README.md
CHANGED
@@ -3,33 +3,53 @@ license: apache-2.0
|
|
3 |
base_model: distilbert-base-uncased
|
4 |
tags:
|
5 |
- generated_from_trainer
|
6 |
-
|
7 |
-
-
|
8 |
-
|
|
|
9 |
---
|
10 |
|
11 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
12 |
-
should probably proofread and complete it, then remove this comment. -->
|
13 |
-
|
14 |
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/pszemraj/eduscore-regression/runs/k6z0kenz)
|
15 |
-
# distilbert-base-uncased
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on the HuggingFaceFW/fineweb-edu-llama3-annotations dataset.
|
18 |
It achieves the following results on the evaluation set:
|
19 |
- Loss: 0.2324
|
20 |
- Mse: 0.2324
|
21 |
|
22 |
-
##
|
23 |
|
24 |
-
|
25 |
|
26 |
-
|
|
|
27 |
|
28 |
-
|
|
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
|
33 |
|
34 |
## Training procedure
|
35 |
|
@@ -46,50 +66,3 @@ The following hyperparameters were used during training:
|
|
46 |
- lr_scheduler_type: linear
|
47 |
- lr_scheduler_warmup_ratio: 0.05
|
48 |
- num_epochs: 1.0
|
49 |
-
|
50 |
-
### Training results
|
51 |
-
|
52 |
-
| Training Loss | Epoch | Step | Validation Loss | Mse |
|
53 |
-
|:-------------:|:------:|:----:|:---------------:|:------:|
|
54 |
-
| 0.5361 | 0.0288 | 100 | 0.4934 | 0.4934 |
|
55 |
-
| 0.3483 | 0.0576 | 200 | 0.3525 | 0.3525 |
|
56 |
-
| 0.3238 | 0.0865 | 300 | 0.2931 | 0.2931 |
|
57 |
-
| 0.2734 | 0.1153 | 400 | 0.3130 | 0.3130 |
|
58 |
-
| 0.2891 | 0.1441 | 500 | 0.3298 | 0.3298 |
|
59 |
-
| 0.2807 | 0.1729 | 600 | 0.2659 | 0.2659 |
|
60 |
-
| 0.2727 | 0.2018 | 700 | 0.2690 | 0.2690 |
|
61 |
-
| 0.2701 | 0.2306 | 800 | 0.2555 | 0.2555 |
|
62 |
-
| 0.2954 | 0.2594 | 900 | 0.2501 | 0.2501 |
|
63 |
-
| 0.2618 | 0.2882 | 1000 | 0.2483 | 0.2483 |
|
64 |
-
| 0.3081 | 0.3171 | 1100 | 0.2456 | 0.2456 |
|
65 |
-
| 0.2544 | 0.3459 | 1200 | 0.2370 | 0.2370 |
|
66 |
-
| 0.2593 | 0.3747 | 1300 | 0.2349 | 0.2349 |
|
67 |
-
| 0.2361 | 0.4035 | 1400 | 0.2406 | 0.2406 |
|
68 |
-
| 0.2536 | 0.4324 | 1500 | 0.2453 | 0.2453 |
|
69 |
-
| 0.26 | 0.4612 | 1600 | 0.2568 | 0.2568 |
|
70 |
-
| 0.2897 | 0.4900 | 1700 | 0.2568 | 0.2568 |
|
71 |
-
| 0.2597 | 0.5188 | 1800 | 0.2359 | 0.2359 |
|
72 |
-
| 0.2489 | 0.5477 | 1900 | 0.2413 | 0.2413 |
|
73 |
-
| 0.2376 | 0.5765 | 2000 | 0.2416 | 0.2416 |
|
74 |
-
| 0.2424 | 0.6053 | 2100 | 0.2418 | 0.2418 |
|
75 |
-
| 0.2798 | 0.6341 | 2200 | 0.2462 | 0.2462 |
|
76 |
-
| 0.2523 | 0.6630 | 2300 | 0.2322 | 0.2322 |
|
77 |
-
| 0.286 | 0.6918 | 2400 | 0.2432 | 0.2432 |
|
78 |
-
| 0.247 | 0.7206 | 2500 | 0.2383 | 0.2383 |
|
79 |
-
| 0.2856 | 0.7494 | 2600 | 0.2375 | 0.2375 |
|
80 |
-
| 0.2216 | 0.7783 | 2700 | 0.2383 | 0.2383 |
|
81 |
-
| 0.255 | 0.8071 | 2800 | 0.2367 | 0.2367 |
|
82 |
-
| 0.2406 | 0.8359 | 2900 | 0.2345 | 0.2345 |
|
83 |
-
| 0.2388 | 0.8647 | 3000 | 0.2282 | 0.2282 |
|
84 |
-
| 0.2571 | 0.8936 | 3100 | 0.2331 | 0.2331 |
|
85 |
-
| 0.2672 | 0.9224 | 3200 | 0.2336 | 0.2336 |
|
86 |
-
| 0.2375 | 0.9512 | 3300 | 0.2337 | 0.2337 |
|
87 |
-
| 0.2423 | 0.9800 | 3400 | 0.2324 | 0.2324 |
|
88 |
-
|
89 |
-
|
90 |
-
### Framework versions
|
91 |
-
|
92 |
-
- Transformers 4.42.3
|
93 |
-
- Pytorch 2.3.1+cu121
|
94 |
-
- Datasets 2.20.0
|
95 |
-
- Tokenizers 0.19.1
|
|
|
3 |
base_model: distilbert-base-uncased
|
4 |
tags:
|
5 |
- generated_from_trainer
|
6 |
+
datasets:
|
7 |
+
- HuggingFaceFW/fineweb-edu-llama3-annotations
|
8 |
+
language:
|
9 |
+
- en
|
10 |
---
|
11 |
|
|
|
|
|
|
|
12 |
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/pszemraj/eduscore-regression/runs/k6z0kenz)
|
13 |
+
# distilbert-base-uncased: edu classifier
|
14 |
+
|
15 |
+
> [!IMPORTANT]
|
16 |
+
> This is a (rare) encoder that supports flash attention 2!
|
17 |
+
> Use `attn_implementation="flash_attention_2"` when loading w/ [FA2 installed](https://github.com/Dao-AILab/flash-attention?tab=readme-ov-file#installation-and-features)
|
18 |
+
> for faster inference.
|
19 |
|
20 |
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on the HuggingFaceFW/fineweb-edu-llama3-annotations dataset.
|
21 |
It achieves the following results on the evaluation set:
|
22 |
- Loss: 0.2324
|
23 |
- Mse: 0.2324
|
24 |
|
25 |
+
## Usage
|
26 |
|
27 |
+
Note this is for CPU, for GPU you will need to make some (small) changes.
|
28 |
|
29 |
+
```py
|
30 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
31 |
|
32 |
+
tokenizer = AutoTokenizer.from_pretrained("pszemraj/mpnet-base-edu-classifier")
|
33 |
+
model = AutoModelForSequenceClassification.from_pretrained("pszemraj/mpnet-base-edu-classifier")
|
34 |
|
35 |
+
text = "This is a test sentence."
|
36 |
+
inputs = tokenizer(text, return_tensors="pt", padding="longest", truncation=True)
|
37 |
+
outputs = model(**inputs)
|
38 |
+
logits = outputs.logits.squeeze(-1).float().detach().numpy()
|
39 |
+
score = logits.item()
|
40 |
+
result = {
|
41 |
+
"text": text,
|
42 |
+
"score": score,
|
43 |
+
"int_score": int(round(max(0, min(score, 5)))),
|
44 |
+
}
|
45 |
+
|
46 |
+
print(result)
|
47 |
+
# {'text': 'This is a test sentence.', 'score': 0.3350256383419037, 'int_score': 0}
|
48 |
+
```
|
49 |
+
|
50 |
+
## Intended uses & limitations
|
51 |
|
52 |
+
Refer to the hf classifier's [model card](https://huggingface.co/HuggingFaceFW/fineweb-edu-classifier#limitations) for more details
|
53 |
|
54 |
## Training procedure
|
55 |
|
|
|
66 |
- lr_scheduler_type: linear
|
67 |
- lr_scheduler_warmup_ratio: 0.05
|
68 |
- num_epochs: 1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|