Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

The output of the features of a given text consists of two tensor. Are they both the deep features? #240

Open
FriedaSmith opened this issue Mar 17, 2021 · 0 comments

Comments

@FriedaSmith
Copy link

I use the following code to get the features of a given text in PyTorch.

from transformers import AlbertTokenizer, AlbertModel

tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2')
model = AlbertModel.from_pretrained("albert-base-v2")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

The result of output is shown in the figure.

output

output consists of two tensor. Are they both the deep features of a given text ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant