Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
thanks a lot for replying. appreciating it really as I'm confused on this point .. so the method which called get_bert_embed_matrix for getting word_embed_6 = torch.cat([hidden_states[i] for i in [-1,-2,-3,-4]], dim=-1) for sub-word and i need to calculate the mean for those values to get word-embedding
excuse me i got from your answer that BERT works on sub-words, not Word. so the method for concatenating the last four layers of BERT will represent sub-words ?