epfml / sent2vec

General purpose unsupervised sentence representations
Other
1.19k stars 256 forks source link

Fixes #36, embed_sentence now uses embed_sentences #37

Closed Fethbita closed 6 years ago

Fethbita commented 6 years ago

This PR changes the embed_sentence that was "kind-of deprecated and very inefficient" and now it calls the embed_sentences with the sentence as single element list.

def embed_sentence(self, sentence, num_threads=1):
    return self.embed_sentences([sentence], num_threads)
Fethbita commented 6 years ago

numpy.squeeze can also be added to ensure compatibility with the old version.

mpagli commented 6 years ago

Looks good to me