# Generating text using NLP based on parameters

I want to generate some text based on the value of certain parameters. For instance, let's say I want to generate descriptions of video games. So, besides real descriptions as training data, I would like that the model takes in account the following parameters (for example) about the game:

• Violent: yes
• Multiplatform: yes
• Drugs: no

So that if the game has drugs content, the output text has some phrase referring to it.

Is this possible? If so, how could I do it in Python? I was going to use LSTM neural networks in Tensorflow.

• Is there no other input to the generation of the description but these 3 binary features? – noe Mar 5 '20 at 13:45
• There may be more binary features, and a little manual introduction (i.e. "Call of duty is") or a categorical feature with the name – Javier López Tomás Mar 5 '20 at 14:22

• It should be possible to do it in Keras. You could create a custom Layer class (inheriting from keras.engine.topology.Layer), add there a parameter with self.add_weight and then just tile it and concatenate it with the input. I have never done something like this, though, so maybe I am missing something. – noe Mar 9 '20 at 18:42