facebookresearch / StarSpace

Learning embeddings for classification, retrieval and ranking.
MIT License
3.94k stars 531 forks source link

StarSpace model #167

Closed Nada-Baili closed 6 years ago

Nada-Baili commented 6 years ago

I am finding some difficulty understanding the starspace model after reading several time the paper I think I understood the training step: the goal is to learn the feature matrix and this is done by minimizing the loss function that has as input the similarity function (cosine) applied on entity pairs What I did not understand is the test part. Suppose we have the matrix trained, if I enter a new document how can I use the model to classify it and find the right label, for example?

ledw commented 6 years ago

@balinda-1995 hi, in the test part, the model outputs the most likely label for a given document according to the similarity function. If you use the -predictionFile flag, then it will output the most likely top k results for each document. I hope that answers your question.

Nada-Baili commented 6 years ago

@ledw Yes, Thanks for your answer!