[Python] Is there any way to view the internal q,k,v configurations of bert in python

Discussão em 'Python' iniciado por Stack, Março 24, 2025.

  1. Stack

    Stack Membro Participativo

    I am doing an NLP project and I need to analyze every aspect of how the process works. Essentially diving into the black box. I need to generate embeddings using bert for my dataset (this i have already done). But while it does it, it has Q, K and V matrices and an attention score - which I must obtain, interpret and visualize. Essentially break into bert without breaking it. How would I approach this?

    I generated the embeddings and those I can visualize but the internal configurations of bert I do not even know where to start to visualize them. I do not want to use chatgpt for this so that's why I am here.

    Continue reading...

Compartilhe esta Página