Update README.md
Browse files
README.md
CHANGED
@@ -5,62 +5,71 @@ model_name: tmpqsu1ee6a
|
|
5 |
tags:
|
6 |
- embeddings
|
7 |
- static-embeddings
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
#
|
11 |
|
12 |
-
This [Model2Vec](https://github.com/MinishLab/model2vec) model is a
|
|
|
13 |
|
|
|
14 |
|
15 |
-
## Installation
|
16 |
-
|
17 |
-
Install model2vec using pip:
|
18 |
```
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
```
|
21 |
|
22 |
-
|
23 |
-
Load this model using the `from_pretrained` method:
|
24 |
-
```python
|
25 |
-
from model2vec import StaticModel
|
26 |
|
27 |
-
# Load a pretrained Model2Vec model
|
28 |
-
model = StaticModel.from_pretrained("tmpqsu1ee6a")
|
29 |
-
|
30 |
-
# Compute text embeddings
|
31 |
-
embeddings = model.encode(["Example sentence"])
|
32 |
```
|
|
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
from model2vec.distill import distill
|
37 |
-
|
38 |
-
# Choose a Sentence Transformer model
|
39 |
-
model_name = "BAAI/bge-base-en-v1.5"
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
# Save the model
|
45 |
-
m2v_model.save_pretrained("m2v_model")
|
46 |
```
|
47 |
|
48 |
-
##
|
49 |
|
50 |
-
|
|
|
|
|
|
|
51 |
|
52 |
-
|
|
|
|
|
|
|
53 |
|
54 |
-
|
|
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
- [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)
|
60 |
|
61 |
## Library Authors
|
62 |
|
63 |
-
Model2Vec was developed by
|
64 |
|
65 |
## Citation
|
66 |
|
|
|
5 |
tags:
|
6 |
- embeddings
|
7 |
- static-embeddings
|
8 |
+
datasets:
|
9 |
+
- HuggingFaceFW/fineweb-edu-llama3-annotations
|
10 |
+
language:
|
11 |
+
- en
|
12 |
+
base_model:
|
13 |
+
- minishlab/potion-base-8M
|
14 |
---
|
15 |
|
16 |
+
# potion-8m-edu-classifier Model Card
|
17 |
|
18 |
+
This [Model2Vec](https://github.com/MinishLab/model2vec) model is a fine-tuned version of [potion-base-8m](https://huggingface.co/minishlab/potion-base-8M).
|
19 |
+
It was trained to predict educational content, analogous to how the [fineweb-edu-classifier](https://huggingface.co/HuggingFaceFW/fineweb-edu-classifier) was used to filter educational content.
|
20 |
|
21 |
+
It achieves the following performance on the evaluation split:
|
22 |
|
|
|
|
|
|
|
23 |
```
|
24 |
+
precision recall f1-score support
|
25 |
+
|
26 |
+
0 0.70 0.42 0.52 5694
|
27 |
+
1 0.75 0.86 0.80 26512
|
28 |
+
2 0.55 0.51 0.53 10322
|
29 |
+
3 0.54 0.45 0.49 3407
|
30 |
+
4 0.59 0.30 0.40 807
|
31 |
+
5 0.00 0.00 0.00 1
|
32 |
+
|
33 |
+
accuracy 0.69 46743
|
34 |
+
macro avg 0.52 0.42 0.46 46743
|
35 |
+
weighted avg 0.68 0.69 0.68 46743
|
36 |
```
|
37 |
|
38 |
+
When thresholded to a binary classifier, it achieves a macro-averaged F1-score of `0.79`. The original classifier achieves `0.81` on the same dataset, but this classifier is orders of magnitude faster on CPU.
|
|
|
|
|
|
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
```
|
41 |
+
precision recall f1-score support
|
42 |
|
43 |
+
not edu 0.96 0.98 0.97 42528
|
44 |
+
edu 0.70 0.54 0.61 4215
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
accuracy 0.94 46743
|
47 |
+
macro avg 0.83 0.76 0.79 46743
|
48 |
+
weighted avg 0.93 0.94 0.93 46743
|
|
|
|
|
49 |
```
|
50 |
|
51 |
+
## Installation
|
52 |
|
53 |
+
Install model2vec with the inference extra using pip:
|
54 |
+
```
|
55 |
+
pip install model2vec[inference]
|
56 |
+
```
|
57 |
|
58 |
+
## Usage
|
59 |
+
Load this model using the `from_pretrained` method:
|
60 |
+
```python
|
61 |
+
from model2vec.inference import StaticModelPipeline
|
62 |
|
63 |
+
# Load a pretrained Model2Vec model
|
64 |
+
model = StaticModelPipeline.from_pretrained("minishlab/potion-8m-edu-classifier")
|
65 |
|
66 |
+
# Predict labels
|
67 |
+
label = model.predict(["Example sentence"])
|
68 |
+
```
|
|
|
69 |
|
70 |
## Library Authors
|
71 |
|
72 |
+
Model2Vec was developed by [Minish](https://github.com/MinishLab).
|
73 |
|
74 |
## Citation
|
75 |
|