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

Chap 3: Fault about TransformerForSequenceClassification #144

Open
1 of 11 tasks
S3nnyK opened this issue Aug 9, 2024 · 0 comments
Open
1 of 11 tasks

Chap 3: Fault about TransformerForSequenceClassification #144

S3nnyK opened this issue Aug 9, 2024 · 0 comments

Comments

@S3nnyK
Copy link

S3nnyK commented Aug 9, 2024

Information

The question or comment is about chapter:

  • Introduction
  • Text Classification
  • Transformer Anatomy
  • Multilingual Named Entity Recognition
  • Text Generation
  • Summarization
  • Question Answering
  • Making Transformers Efficient in Production
  • Dealing with Few to No Labels
  • Training Transformers from Scratch
  • Future Directions

Question or comment

In TransformerForSequenceClassification, x = self.encoder(x)[:, 0, :] means [CLS] token is included in the inputs. However, in the beginning of this chapter, inputs is defined as tokenizer(text, return_tensors="pt", add_special_tokens=False), without special_tokens. Hence, the 0-th is "time", not "[CLS]".

@S3nnyK S3nnyK changed the title Fault about TransformerForSequenceClassification Chap 3: Fault about TransformerForSequenceClassification Aug 9, 2024
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

1 participant