-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can you please add a script to test the bert trained model ? #4
Comments
Just for more clarity so for example i have saved set_count_1.h5 model for the first set and similarly i want to test more data with the help of this model for the same set. but I am not able to produce a script. |
I have worked on a script, let me know if it make sense: `import time cuda = torch.device('cuda') For DistilBERT:model_class, tokenizer_class, pretrained_weights = (ppb.DistilBertModel, ppb.DistilBertTokenizer, 'distilbert-base-uncased') tokenized_test = test_essays.apply((lambda x: tokenizer.encode(x, add_special_tokens=True ,max_length=200))) max_len = 0 with torch.no_grad(): test_features = last_hidden_states_test[0][:,0,:].numpy() train_x,train_y = train_features.shape testDataVectors = np.reshape(test_features,(test_x,1,test_y)) lstm_model.load_weights("./model_weights/final_lstm1.h5") |
Thanks for this amazing work, can you please add a script for testing the saved lstm model with bert featurizer? @Gaurav-Pande
The text was updated successfully, but these errors were encountered: