Skip to content
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

frame level contextual features #40

Open
AswiniKumar1995 opened this issue Feb 21, 2023 · 1 comment
Open

frame level contextual features #40

AswiniKumar1995 opened this issue Feb 21, 2023 · 1 comment

Comments

@AswiniKumar1995
Copy link

Dear sir,

Can I get all the token-level output contextual features from the model?

@GokulNC
Copy link
Member

GokulNC commented Feb 26, 2023

Hi @AswiniKumar1995 , apologies for late reply.

Yes, you can get token-level output from BERT, but you will have to make changes in the source-code.
This is not available by default in this library, because we currently support only ISLR, which means it aggregates all the frame-level features and tries to classify it to a single sign.

This is the place where the pooling happens:

if self.pooling_type == "cls":
x = x[:, 0]
elif self.pooling_type == "max":
x = torch.max(x, dim=1).values
elif self.pooling_type == "avg":
x = torch.mean(x, dim=1)
elif self.pooling_type == "att":
x = self.attn_block(x)

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

No branches or pull requests

2 participants