moshew commited on
Commit
6448dc5
1 Parent(s): e0487d7

Push Keras model using huggingface_hub.

Browse files
README.md CHANGED
@@ -4,50 +4,17 @@ library_name: keras
4
 
5
  ## Model description
6
 
7
- >x100 smaller size vs. DistilBERT with less than 0.5 drop in accuracy evaluated on SST-2 test dataset
8
 
9
- DistilBERT - 67M parameters (92.2 accuracy)
10
- DistlBiLSTM - 66K parameters (91.7 accuracy)
11
 
 
12
 
13
- ## How to get Started with the model
14
-
15
- Example of ruuning prediction and evaluation on SST-2 test dataset
16
- ​​
17
-
18
- ```python
19
- import torch
20
- !pip install setfit
21
-
22
- from datasets import load_dataset
23
- import numpy as np
24
- from sklearn.metrics import accuracy_score
25
- from keras.preprocessing.text import Tokenizer
26
- from keras.utils import pad_sequences
27
- import tensorflow as tf
28
- from huggingface_hub import from_pretrained_keras
29
-
30
- sst2 = load_dataset("SetFit/sst2")
31
- augmented_sst2_dataset = load_dataset("jmamou/augmented-glue-sst2")
32
-
33
- tokenizer = Tokenizer(num_words=10000)
34
- tokenizer.fit_on_texts(augmented_sst2_dataset['train']['sentence'])
35
- test_sequences = tokenizer.texts_to_sequences(sst2['test']['text'])
36
- test_padded = pad_sequences(test_sequences, padding='post', truncating='post', maxlen=64)
37
-
38
- reloaded_model = from_pretrained_keras('moshew/distilbilstm-finetuned-sst-2-english')
39
-
40
- pred=reloaded_model.predict(test_padded)
41
- pred_bin = np.argmax(pred,1)
42
- accuracy_score(pred_bin, sst2['test']['label'])
43
- reloaded_model.summary()
44
- ```
45
- 0.9176276771004942
46
 
 
47
 
48
  ## Training procedure
49
-
50
- Distillation with data augmentation
51
 
52
  ### Training hyperparameters
53
 
 
4
 
5
  ## Model description
6
 
7
+ More information needed
8
 
9
+ ## Intended uses & limitations
 
10
 
11
+ More information needed
12
 
13
+ ## Training and evaluation data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ More information needed
16
 
17
  ## Training procedure
 
 
18
 
19
  ### Training hyperparameters
20
 
keras_metadata.pb CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bdc9162976c7f360a635a783e3fd4c8532cf10a283749e9f7992205d76f56b73
3
- size 31190959
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:919c45b0d0ee9e0d922c8b4db2ad15746e1c5fe92afd8384a09d9075c43bc24c
3
+ size 31191049
model.png CHANGED
saved_model.pb CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4e3ae73b513d680dab07db1b446fd42324270b1acdc3e844994a242ee83b4894
3
- size 4444324
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05da91ebaaec30e75ef2ea2718c02bef1fab0a671dcd6e8f5e4acd832229ed18
3
+ size 4451217
variables/variables.data-00000-of-00001 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fa81ae96adf7a5ffd50d2aa60afe8f3191970558fffb26ab6cb8d1e3679d748e
3
- size 2644550
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c26dab890f18c809e99d5a807d01325327075265ab409cbc8f8ce4bd0e9043b9
3
+ size 2644586
variables/variables.index CHANGED
Binary files a/variables/variables.index and b/variables/variables.index differ