oborchers / Fast_Sentence_Embeddings

Compute Sentence Embeddings Fast!
GNU General Public License v3.0
618 stars 83 forks source link

train on data and predict on new data #2

Closed spedygiorgio closed 5 years ago

spedygiorgio commented 5 years ago

Hi I see that the train method of an fse object returns the sentence embedding. Is threre a predict method to apply the trained modeled on new data? Or train stays for predict?

Best

oborchers commented 5 years ago

Hi! Train is the equivalent of the predict function. However, I think I will rename the function to „infer“ in a future version.

spedygiorgio commented 5 years ago

thank you

oborchers commented 5 years ago

@spedygiorgio I have included a train and a predict method. Some embeddings (SIF, uSIF) require the estimation of components, which is performed during training. If you apply infer to a new set of sentences it will only remove the components, but not re-estimate the components.

See the notebook for an example