Closed summerstay closed 4 years ago
For example, this one-line change:
latent_z1, coded_length1 = latent_code_from_text("a brown dog likes to eat his food very slowly .", tokenizer_encoder, model_vae, args)
latent_z2, coded_length2 = latent_code_from_text("a yellow cat likes to chase a long string .", tokenizer_encoder, model_vae, args)
latent_z3, coded_length3 = latent_code_from_text("a yellow cat likes to chase a short string .", tokenizer_encoder, model_vae, args)
result = text_from_latent_code(latent_z2 - latent_z3 + latent_z1, model_vae,coded_length1,args, tokenizer_decoder)
results in the sentence "a brown dog likes to eat his whole food so fast.", so is forming sentence analogies.
Brilliant work. I update the code to incorporate the functions (edited a bit), see here.
Releasing a demo for latent space manipulation, including sentence interpolation and analogy. Hope it makes it easier to interact with the model.
Your program works very well! I rewrote the interpolation function to make it easier for me to use in different ways. Perhaps others would also find this useful.