TheophileBlard / french-sentiment-analysis-with-bert

How good is BERT ? Comparing BERT to other state-of-the-art approaches on a French sentiment analysis dataset
MIT License
146 stars 35 forks source link

Getting word embeddings after training the model #11

Open cemrifki opened 3 years ago

cemrifki commented 3 years ago

Hi Théophile,

I hope you are doing well.

I would like to obtain word embeddings after having trained the model. That is, first, I will use training data with sentiment labels to generate the model. Then I would feed a test sentence (e.g. Tu as aimé cela.) into the system. Afterwards, I would like to get the vectors of the words Tu, as, aimé and cela, created with respect to this model. That is, in the testing phase, I am interested in those word embeddings only, not the predicted sentiment label of the test data. Is it possible? If so, how could I perform this task? Could you please show it to me through an example code snippet?

Thank you very much for your interest in advance, Cem Rifki Aydin