Update README.md
Browse files
README.md
CHANGED
@@ -15,11 +15,14 @@ More information needed
|
|
15 |
|
16 |
## Training and evaluation data
|
17 |
|
|
|
|
|
18 |
from datasets import load_dataset
|
19 |
import numpy as np
|
20 |
from sklearn.metrics import accuracy_score
|
21 |
from keras.preprocessing.text import Tokenizer
|
22 |
from keras.utils import pad_sequences
|
|
|
23 |
from huggingface_hub import from_pretrained_keras
|
24 |
|
25 |
sst2 = load_dataset("SetFit/sst2")
|
@@ -36,7 +39,9 @@ pred=reloaded_model.predict(test_padded)
|
|
36 |
pred_bin = np.argmax(pred,1)
|
37 |
accuracy_score(pred_bin, sst2['test']['label'])
|
38 |
|
39 |
-
0.9176276771004942
|
|
|
|
|
40 |
|
41 |
## Training procedure
|
42 |
|
|
|
15 |
|
16 |
## Training and evaluation data
|
17 |
|
18 |
+
!pip install setfit
|
19 |
+
|
20 |
from datasets import load_dataset
|
21 |
import numpy as np
|
22 |
from sklearn.metrics import accuracy_score
|
23 |
from keras.preprocessing.text import Tokenizer
|
24 |
from keras.utils import pad_sequences
|
25 |
+
import tensorflow as tf
|
26 |
from huggingface_hub import from_pretrained_keras
|
27 |
|
28 |
sst2 = load_dataset("SetFit/sst2")
|
|
|
39 |
pred_bin = np.argmax(pred,1)
|
40 |
accuracy_score(pred_bin, sst2['test']['label'])
|
41 |
|
42 |
+
0.9176276771004942
|
43 |
+
|
44 |
+
reloaded_model.summary()
|
45 |
|
46 |
## Training procedure
|
47 |
|