lajanugen / S2V

ICLR 2018 Quick-Thought vectors
https://arxiv.org/pdf/1803.02893.pdf
Apache License 2.0
205 stars 64 forks source link

Easiest way to use the model as a "library"? #13

Open JohnGiorgi opened 4 years ago

JohnGiorgi commented 4 years ago

Hi,

I am interested in comparing to your QuickThoughts method by evaluating it on the full SentEval benchmark. To do that I need to write something like the following:

def batcher(params, batch):
    batch = [sent if sent != [] else ["."] for sent in batch]
    embeddings = params.model.encode(batch)
    embeddings = np.vstack(embeddings)
    return embeddings

Is there a way for me to import your pre-trained model, and use it similar to the above code? E.g. is there a workflow for embedding lists of strings?