# How to pass more than 2 input columns to a Deep learning Keras model for sequence tagging/labeling

I have to build a neural network which extract relationship between two entities.Input should be: Input text/paragraph, vocabulary of entities and relationship phrases that system should recognize.

Output is sequence of tags and length of output sequence and input text/paragraph is same.

Dataset is a CSV file having 3 input columns(input text, entities in text, relationship between 2 entities) and 1 output column. I am using Keras library to build this model.

Example-input1: zomato acquires uber; input2: zomato, uber; input3: acquires ; Output: some-tag some-tag some-tag (note: these are not actual tags just an example)

I planned to use a char embedding for input text using time distributed layer with Bi-LSTM but now got stuck with 3 inputs. I am aware of keras functional api but how can I use it in a sequence tagging problem with time distributed layer. If any other approach can be used to avoid this problem, please suggest.

• Why do you want to model three inputs? Tell me if I'm wrong but don't you want to get an output like - [entity_1, relationship, entity_2]  for zomato acquires uber? – ashutosh singh Apr 19 '20 at 19:51
• Instead of exact keywords given in input like entity_1, here I want to tag entity like" b-org relation b-org "and if sentence has words other than entity and relationship, 'Other' or 'O' tag will be added. So total 3 kinds of label are there b-org, relation and O in output. – Sneha.Priya Apr 21 '20 at 4:18
• Also this is just a simple example, relationship and entities can be anywhere in a sentence not necessarily in a sequence like the above example. – Sneha.Priya Apr 21 '20 at 4:40
• If I understand it correctly, you don't have multiple inputs. You just have a single sequence to tag. – ashutosh singh Apr 21 '20 at 12:13
• Why do you want to model different inputs? – ashutosh singh Apr 21 '20 at 13:19