facebookresearch / InferSent

InferSent sentence embeddings
Other
2.28k stars 473 forks source link

Decode sentence embedding to sentence #135

Open HareeshKumarKuruba opened 4 years ago

HareeshKumarKuruba commented 4 years ago

I am using infersent to embed sentences. Also at some point i want to decode embedding back to sentence. i tried infersent.decode(sentences) and got following error.

AttributeError: 'InferSent' object has no attribute 'decode'

is there an API to decode embedding to sentence with infersent?

nickyeolk commented 4 years ago

I am not sure what you mean by decoding sentences. Do you mean you want to recover the original sentence from the embeddings? If so that is not possible since encoding is a many-to-one function, meaning many sentences can have very similar embeddings. Additionally the model was trained on a SNLI task rather than some sort of sequence to sequence model so it only has encoder weights.