Data Science, Machine Learning, NLP, Transformers, Word Embeddings.
torch.no_grad(): outputs = model(input_ids, segments_ids) hidden_states = outputs[2] Let’s examine what we’ve got. print ("Number of layers:", len(hidden_states), " (initial embeddings + 12 BERT layers)") print ("Number of batches:", len(hidden_states[0])) print ("Number of tokens:",