Tehnički Vjesnik (Jan 2020)

An RNN Model for Generating Sentences with a Desired Word at a Desired Position

  • Tianbao Song,
  • Jingbo Sun,
  • Yinbing Zhang,
  • Weiming Peng*,
  • Jihua Song

DOI
https://doi.org/10.17559/TV-20190929153200
Journal volume & issue
Vol. 27, no. 1
pp. 81 – 88

Abstract

Read online

Generating sentences with a desired word is useful in many natural language processing tasks. State-of-the-art recurrent neural network (RNN)-based models mainly generate sentences in a left-to-right manner, which does not allow explicit and direct constraints on the words at arbitrary positions in a sentence. To address this issue, we propose a generative model of sentences named Coupled-RNN. We employ two RNN's to generate sentences backwards and forwards respectively starting from a desired word, and inject position embeddings into the model to solve the problem of position information loss. We explore two coupling mechanisms to optimize the reconstruction loss globally. Experimental results demonstrate that Coupled-RNN can generate high quality sentences that contain a desired word at a desired position.

Keywords