lfmatosm/embedded-topic-model

How could I get the topic embeddings?

Opened this issue · 3 comments

Hello!
How could I get the topic embeddings, which is mentioned as alpha in the ETM original paper?
Thanks and waiting for your response!

Hi @broboboo, how are you?
Thanks for your question. Currently, there's no method to retrieve the topic embeddings. They are initially defined here:

self.alphas = nn.Linear(rho_size, num_topics, bias=False)

I'm currently on a deadline in other projects, but as soon as I can, I will update the package to address this shortcoming.
I'm also open for pull requests, so feel free if its your cup of tea :)

Thanks for your answer!
I found i can get the topic embeddings by this:
topic_embeddings = etm_instance.model.alphas.weight.detach().cpu().numpy()
Is this correct?
Thank you!

@broboboo yes, that's correct. Sorry for the delay.