text_gcn icon indicating copy to clipboard operation
text_gcn copied to clipboard

How do you get the top 10 words for each class ?

Open Dinxin opened this issue 4 years ago • 1 comments

Dinxin avatar Mar 07 '20 06:03 Dinxin

@Dinxin

The dimension of the second layer node (word/doc) embeddings is the same as the number of classes, the top 10 words with highest value in each dimension will be the top 10 words for each class.

Changing "model.layers[0].embedding" in line 120, train.py to "model.layers[1].embedding, then "word_embeddings" in line 161, train.py will be the word embeddings, you can choose top 10 words in each dimension (class).

yao8839836 avatar Mar 09 '20 13:03 yao8839836