Update README.md
Browse files
README.md
CHANGED
@@ -33,14 +33,15 @@ augmented_sst2_dataset = load_dataset("jmamou/augmented-glue-sst2")
|
|
33 |
tokenizer = Tokenizer(num_words=10000)
|
34 |
tokenizer.fit_on_texts(augmented_sst2_dataset['train']['sentence'])
|
35 |
|
36 |
-
# Encode
|
37 |
test_sequences = tokenizer.texts_to_sequences(sst2['test']['text'])
|
38 |
|
39 |
-
# Pad the
|
40 |
test_padded = pad_sequences(test_sequences, padding=pad_type = 'post', truncating=trunc_type = 'post', maxlen=64)
|
41 |
|
42 |
reloaded_model = from_pretrained_keras('moshew/distilbilstm-finetuned-sst-2-english')
|
43 |
|
|
|
44 |
pred=reloaded_model.predict(test_padded)
|
45 |
pred_bin = np.argmax(pred,1)
|
46 |
accuracy_score(pred_bin, sst2['test']['label'])
|
|
|
33 |
tokenizer = Tokenizer(num_words=10000)
|
34 |
tokenizer.fit_on_texts(augmented_sst2_dataset['train']['sentence'])
|
35 |
|
36 |
+
# Encode test data sentences into sequences
|
37 |
test_sequences = tokenizer.texts_to_sequences(sst2['test']['text'])
|
38 |
|
39 |
+
# Pad the test sequences
|
40 |
test_padded = pad_sequences(test_sequences, padding=pad_type = 'post', truncating=trunc_type = 'post', maxlen=64)
|
41 |
|
42 |
reloaded_model = from_pretrained_keras('moshew/distilbilstm-finetuned-sst-2-english')
|
43 |
|
44 |
+
#Evaluate model on SST2 test data (GLUE)
|
45 |
pred=reloaded_model.predict(test_padded)
|
46 |
pred_bin = np.argmax(pred,1)
|
47 |
accuracy_score(pred_bin, sst2['test']['label'])
|