Search code examples
textsimilaritytext-classificationfasttext

How to get last layer before classification layer on fasttext?


I would like to solve a text similarity problem using fasttext. I am able to create model to get text classification labels using fasttext. But I would like to get document vector which is created for classification layer input generating fasttext model. Then using some similarity methods get the scores .

How can I do that ? Any help would be great

Thanks


Solution

  • I'm fairly sure FastText's supervised mode interim value is just an average of all the input text's word-vectors. So you can request the individual word-vectors, then average them together yourself.