Bert, NLP.
Run the text through BERT, and collect all of the hidden states produced # from all 12 layers. with torch.no_grad(): outputs = model(tokens_tensor, segments_tensors) # Evaluating the model will return a different number of objects based on # how it's configured in the `from_pretrained` call